The nature of the code given in the following examples is explained in the index document.
Many interesting integer sequences can be derived by selecting
palindromes from base sequences.
The calculations given below explore such derivations.
A decimal palindrome is a number for which the digits
of its decimal expression are the same whether taken from right to left
left to right.
The sine qua non of an investigation of decimal palindromes is
therefore a function which will select decimal palindromes from a list
of integers.
In this function the |.&.": reverses the decimal digits of
its argument, while the "0 is needed to make the reversal
deal with the numbers in the argument individually.
In the rest of the function, the #~ copies which numbers
coming in are = to their palindrome.
The simplest place to start is the integers starting at zero.
This sequence is in the Encyclopedia as
A002113.
An inspection of the
(relevant part of the Encyclopedia's index shows that a lot of attention
has been paid to palindromes.)
The simplest next thing to find is the palindromic primes.
This sequence is in the Encyclopedia as
A002385.
The gaps carry their own message.
Decimal Palindromes
The most obvious palindromic integers are the decimal ones.
Thus 121 484 and 676 are decimal palindromes,
but 144 529 and 5729 are not.
dplm =: #~ (= |.&.":"0) NB. the function
(|.&.":"0) 9+i.21 NB. 9 to 29
9 1 11 21 31 41 51 61 71 81 91 2 12 22 32 42 52 62 72 82 92
dplm i.120 NB. the first twenty one
0 1 2 3 4 5 6 7 8 9 11 22 33 44 55 66 77 88 99 101 111
dplm p. i.135 NB. up past the 5??s
2 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757