login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A261198 Start with n and repeat the map x -> x+sumdigits(x) until reaching a prime, which is a(n), or 0 if no prime is reached. 1

%I #51 Oct 05 2015 11:52:11

%S 2,23,0,23,11,0,19,23,0,11,13,0,17,19,0,23,37,0,29,41,0,41,101,0,37,

%T 41,0,101,59,0,43,37,0,41,43,0,47,101,0,59,67,0,89,59,0,67,71,0,101,

%U 89,0,59,61,0,89,67,0,71,73,0,103,101,0,127,89,0,109,103,0,101,79,0,83,127,0,89,101,0,109,109,0,103,107,0,127,101,0,109,113,0,101,103,0,107,109,0,113,127,0,101

%N Start with n and repeat the map x -> x+sumdigits(x) until reaching a prime, which is a(n), or 0 if no prime is reached.

%C Multiples of 3 never reach a prime because (multiple(3) + sumdigits of (multiple(3)) is always a multiple of 3.

%H Maghraoui Abdelkader, <a href="/A261198/b261198.txt">Table of n, a(n) for n = 1..100</a>

%e a(3)=0; a(6)=0; a(9)=0 as 3,6,9 are multiples of 3.

%e n=2; a0=2; a1=2+sumdigits(2)=4; a2=4+sumdigits(4)=8; a3=8+sumdigits(8)=16;

%e a4=16+sumdigits(16)=16+7=23; a4 is prime, so a(2)=23;

%e a(14)=14+(1+4=19); 19 is prime.

%e a(16)=16+(1+6)=23; 23 is prime.

%o (PARI)

%o verif(n)={if((n%3)==0, print1(0,", ");return(););

%o b=1; a=n;

%o while(b<10, a=a+sumdigits(a) ;if(isprime(a),print1(a,", "); b=20))}

%o for(n=1, 100, verif(n);)

%Y Cf. A000040, A001651, A008585, A154561.

%K nonn,base

%O 1,1

%A _Maghraoui Abdelkader_, Sep 30 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)