OFFSET
1,1
COMMENTS
Since twin primes greater than (3,5) are either occur as (5,7) mod 12 or (11,1) mod 12, all sums of such twin primes are divisible by 12. Thus all powers are divisible by 12 and are best looked at in base 12. For example, a(3) = 5E + 61 = 100, where E is eleven.
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 1..10000
EXAMPLE
8 = 2^3 = 3 + 5 (twin primes). Thus 8 is a member of this sequence.
36 = 6^2 = 17 + 19 (twin primes). Thus 36 is a member of this sequence.
a(3) = 71 + 73 = 144.
MAPLE
egcd := proc(n::nonnegint) local L; if n=0 or n=1 then n else L:=ifactors(n)[2]; L:=map(z->z[2], L); igcd(op(L)) fi end: L:=[]: for w to 1 do for x from 1 to 2*12^2 do s:=6*x; for r from 2 to 79 do t:=s^r; if egcd(s)=1 and andmap(isprime, [(t-2)/2, (t+2)/2]) then print((t-2)/2, (t+2)/2, t)); L:=[op(L), [(t-2)/2, (t+2)/2, t]]; fi; od od od; L:=sort(L, (a, b)->a[1]<b[1]); map(z->z[3], L);
MATHEMATICA
Lim=2600000; ts=Select[Prime[Range[PrimePi[Lim]]], PrimeQ[# + 2] &]2+2; pp=Join[{1}, Select[Range[Lim], GCD@@FactorInteger[#][[All, 2]]>1&]] ; s={}; Do[ If[MemberQ[ pp, ts[[n]]], AppendTo[s, ts[[n]]]] , {n, Length[ts]}]; s (* James C. McMahon, Sep 18 2024 *)
PROG
(PARI) a(N) = for(n=1, N, if(ispower(n), if(nextprime(n/2)-precprime(n/2)==2&&precprime(n/2)+nextprime(n/2)==n, print1(n, ", ")))) \\ vary the program's range for any N; Derek Orr, Jul 27 2014
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Walter Kehowski, Jun 18 2006
EXTENSIONS
R. J. Mathar pointed out that 8 was missing. Once corrected, the old A245591 could be merged into this entry. - N. J. A. Sloane, Jul 30 2014
STATUS
approved