OFFSET
1,1
COMMENTS
If we start with a positive number less than 5 the sequence enters almost immediately into a 1-term loop.
The authors wanted the sequence to oscillate evenly around zero by giving different weights to the nonprime vs prime digits: 0, 1, 4, 6, 8, 9 have respective weights 1, 2, 5, 7, 9, 10 (total 34) and 2, 3, 5, 7 become 4, 6, 10, 14 (same total 34).
The result is not convincing after 10^5 terms, the sequence staying for almost 95% of the time above zero. But who knows what will happen after 10^10 terms, for instance?
LINKS
Jean-Marc Falcoz, Table of n, a(n) for n = 1..65531
EXAMPLE
The sequence S begins with 5,15,13,23,21,27,31,37,...
As a(1) = 5 and the 1st digit of S is prime (5), we get a(2) = a(1) + 2*5 = 5 + 10 = 15;
as a(2) = 15 and the 2nd digit of S is not prime (1), we get a(3) = a(2) - 1 - 1 = 15 - 2 = 13;
as a(3) = 13 and the 3rd digit of S is prime (5), we get a(4) = a(3) + 2*5 = 13 + 10 = 23;
as a(4) = 23 and the 4th digit of S is not prime (1), we get a(5) = a(4) - 1 - 1 = 23 - 2 = 21;
as a(5) = 21 and the 5th digit of S is prime (3), we get a(6) = a(5) + 2*3 = 21 + 6 = 27;
as a(6) = 27 and the 6th digit of S is prime (2), we get a(7) = a(6) + 2*2 = 27 + 4 = 31;
etc.
CROSSREFS
KEYWORD
base,sign
AUTHOR
Eric Angelini and Jean-Marc Falcoz, Aug 10 2019
STATUS
approved