|
|
A323175
|
|
A Syracuse-like routine producing loops (see the Comments section).
|
|
2
|
|
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 32, 33, 34, 35, 36, 37, 74, 75, 76, 77, 78, 79, 98, 99, 100, 101, 102, 103, 302, 303, 304, 305, 306, 307, 704, 705, 706, 707, 708, 709, 908, 909, 910, 911, 120, 121, 122, 123, 124, 125, 126, 127, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 338, 339, 340, 341, 342, 343
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Here is the 4-step routine:
(1) Start with any integer > 0
(2) Add 1 and print
(3) If the result is a composite number go to (2), else go to (4)
(4) Reverse the digits of the result and go to (2)
This routine keeps adding 1 to an integer, until the result is a prime number; then the digits of the prime number are reversed and the routine goes on. With this simple rule, no leading-zero problem will ever occur.
Jean-Marc Falcoz noticed that all integers < 1000000 will end sooner or later into a loop. Might there exist an integer with a different fate?
As we don't want duplicate terms, this sequence ends with its 143th term, which is 809; the next one (909) is already in the sequence.
|
|
LINKS
|
|
|
EXAMPLE
|
The term after a(12) = 12 will be a(13) = 13 as 12 + 1 = 13 ; then 13, being a prime number, will be reversed in 31 and augmented by 1, which will produce the next term, a(14) = 32
|
|
PROG
|
(PARI) terms(n) = my(x=1, i=0); while(1, if(i==n, break); print1(x, ", "); i++; if(!ispseudoprime(x), x++, x=eval(concat(Vecrev(Str(x))))+1))
/* Print initial 70 terms as follows */
|
|
CROSSREFS
|
A323204 shows a variant of this sequence that avoids duplicates (and loops).
|
|
KEYWORD
|
base,nonn,fini,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|