login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Primes p such that repeated application of A062028 (add sum of digits) yields two other primes in a row: p, A062028(p) and A062028(A062028(p)) are all prime.
1

%I #13 Dec 17 2020 19:56:03

%S 11,59,101,149,167,257,277,293,367,419,479,547,617,727,839,1409,1559,

%T 1579,1847,2039,2129,2617,2657,2837,3449,3517,3539,3607,3719,4217,

%U 4637,4877,5689,5779,5807,5861,6037,6257,6761,7027,7489,7517,8039,8741,8969,9371,9377,10667,10847,10937,11257,11279,11299,11657

%N Primes p such that repeated application of A062028 (add sum of digits) yields two other primes in a row: p, A062028(p) and A062028(A062028(p)) are all prime.

%C "Iterates" the idea of A048519 (p and A062028(p) are prime), also considered in A048523, A048524, A048525, A048526, A048527. (This is the union of A048524, A048525, A048526, A048527 etc. A048525(1) = 277 = a(7).)

%H Robert Israel, <a href="/A320882/b320882.txt">Table of n, a(n) for n = 1..10000</a>

%p f:= n -> n + convert(convert(n,base,10),`+`):

%p filter:= proc(n) local x;

%p if not isprime(n) then return false fi;

%p x:= f(n);

%p isprime(x) and isprime(f(x))

%p end proc:

%p select(filter, [seq(i,i=3..10000,2)]); # _Robert Israel_, Dec 17 2020

%o (PARI) is_A320882(n,p=n)=isprime(p=A062028(p))&&isprime(A062028(p))&&isprime(n) \\ Putting isprime(n) to the end is more efficient for the frequent case when the terms are already known to be prime.

%o forprime(p=1,14999,isprime(q=A062028(p))&&isprime(A062028(q))&&print1(p","))

%Y Subsequence of A048519: p and A062028(p) are prime.

%Y Cf. A047791, A048520, A006378, A107740, A243441 (p and p + Hammingweight(p) are prime), A243442 (analog for p - Hammingweight(p)).

%Y Cf. A048523, ..., A048527, A320878, A320879, A320880: primes starting a chain of length 2, ..., 9 under iterations of A062028(n) = n + digit sum of n.

%K nonn,base

%O 1,1

%A _M. F. Hasler_, Nov 06 2018