login
A396758
Larger 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.
0
2339, 3329, 12149, 21149, 21347, 23899, 30103, 32309, 33029, 123407, 213229, 221239, 230309, 238099, 245789, 254879, 278549, 280939, 289039, 300239, 302417, 302989, 304217, 312407, 323009, 329089, 336403, 340127, 342107, 344969, 396449, 398029, 401237, 413207, 475289, 478259
OFFSET
1,1
COMMENTS
Equivalently, consecutive happy sexy primes where both primes produce a second prime.
Conjecture: This sequence has an infinite number of terms.
All terms of this sequence go through a minimum of three iterations before going to the value of 1.
REFERENCES
Liz Strachan, Numbers Are Forever, Constable, London, 2014, p. 92.
FORMULA
a(n) = A396234(n) + 6.
EXAMPLE
2339 is a term because it is the larger prime of a consecutive sexy prime pair (2333, 2339) where 2339 is a happy prime because 2339 --> 2^2 + 3^2 + 3^2 + 9^2 = 4 + 9 + 9 +81 = 103 --> 1^2 + 0^2 + 3^2 = 1 + 0 + 9 = 10 --> 1^2+0^2 = 1 --> 1^2 = 1, and the first iteration of 2339 produces the prime number 103. The smaller term, p = 2333, is also a happy prime because 2333 --> 2^2 + 3^2 + 3^2 + 3^2 = 4 + 9 + 9 + 9 = 31 --> 3^2 + 1^2 = 9 + 19 = 10 --> 1^2 + 0^2 = 1 --> 1^2 = 1 and the first iteration produces the prime number 31.
3307, of the consecutive sexy prime pair (3301, 3307) is not a term because, while both primes produce primes on their first iterations, 3307 is not a happy number.
Both the larger and smaller term of consecutive sexy prime pairs must be happy primes and both must produce another prime on their first iteration for the larger term to be a term of this sequence.
The largest terms of prime triples are not terms because the sexy prime pairs are not consecutive primes.
MATHEMATICA
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]]] + 6]; seq[50000] (* Amiram Eldar, Jun 05 2026 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Harry E. Neel, Jun 04 2026
STATUS
approved