

A309620


Start with a(1) = 5. For n>1, the sequence is always extended with a(n+1) = a(n) + 2*d if d is prime, and with a(n+1) = a(n)  1  d if d is not prime, where d is the nth digit of the sequence.


1



5, 15, 13, 23, 21, 27, 31, 37, 41, 39, 43, 57, 63, 61, 67, 81, 76, 74, 80, 70, 65, 71, 81, 95, 88, 94, 87, 85, 78, 92, 83, 81, 95, 88, 102, 97, 88, 87, 101, 100, 93, 103, 117, 115, 106, 104, 94, 104, 95, 86, 76, 71, 62, 76, 67, 77, 91, 82, 72, 76, 67, 73, 64, 62, 52, 62, 53, 44, 42, 41, 45, 35, 49, 40, 31, 22, 36, 34, 33, 31
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

If we start with a positive number less than 5 the sequence enters almost immediately into a 1term 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

JeanMarc 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

Cf. A309521 (a variant).
Sequence in context: A302841 A113259 A298265 * A291794 A321775 A166621
Adjacent sequences: A309617 A309618 A309619 * A309621 A309622 A309623


KEYWORD

base,sign


AUTHOR

Eric Angelini and JeanMarc Falcoz, Aug 10 2019


STATUS

approved



