login
Smaller term of pairs of consecutive primes of the form p, p+6 where both primes eventually reach a value of 1 under iteration of the sums of the squares of their digits and the first iteration of both terms are also prime.
1

%I #31 Jun 04 2026 00:04:59

%S 2333,3323,12143,21143,21341,23893,30097,32303,33023,123401,213223,

%T 221233,230303,238093,245783,254873,278543,280933,289033,300233,

%U 302411,302983,304211,312401,323003,329083,336397,340121,342101,344963,396443,398023,401231,413201,475283,478253

%N Smaller term of pairs of consecutive primes of the form p, p+6 where both primes eventually reach a value of 1 under iteration of the sums of the squares of their digits and the first iteration of both terms are also prime.

%C Equivalently, consecutive happy sexy primes where both primes produce a second prime.

%C Conjecture: this sequence has an infinite number of terms.

%C All terms of this sequence go through a minimum of three iterations before going to the value of 1.

%D Liz Strachan, Numbers Are Forever, Constable, London, 2014, p. 92.

%e 2333 is a term because it is the smaller of a consecutive sexy prime pair (2333, 2339) where 2333 is a happy prime because 2333 --> 2^2 + 3^2 + 3^2 + 3^2 = 4 + 9 + 9 + 9 = 31 --> 3^2 + 1^2 = 10 --> 1^2 = 1 --> 1^2 = 1, and the first iteration produces the prime number 31. The larger term, p = 2339 is also a happy prime because 2339 --> 2^2 + 3^2 + 3^2 + 9^2 = 103 --> 1^2 + 0^2 + 3^2 = 10 --> 1^2 = 1 --> 1^2 = 1, and the first iteration produces the prime number 103.

%e Both the smaller and larger term of consecutive sexy prime pairs must be happy primes and both must produce another prime on their first iteration for the smaller term to be a term of this sequence.

%e The happy sexy prime p=3301 is not a term because the next term (p+6) is not a happy prime.

%e The smallest terms of prime triples are not terms because the sexy prime pairs are not consecutive primes.

%t s[n_] := Total[IntegerDigits[n]^2]; happyQ[n_] := NestWhile[s, n, UnsameQ, All] == 1; seq[lim_] := Module[{ps = Prime[Range[lim]], ind}, ind = Position[ps, _?(PrimeQ[s[#]] && happyQ[#] &), 1] // Flatten; ps[[Intersection[-1 + ind[[1 + Position[Differences[ind], 1] // Flatten]], Position[Differences[ps], 6] // Flatten]]]]; seq[50000] (* _Amiram Eldar_, May 22 2026 *)

%Y Cf. A035497, A007770, A046519, A023201, A078854.

%K nonn,base

%O 1,1

%A _Harry E. Neel_, May 19 2026