OFFSET
1,2
COMMENTS
Twin prime powers, a generalization of the twin primes. The twin primes are a subsequence.
From Daniel Forgues, Aug 17 2009: (Start)
Numbers k such that k + (0, 2) is a prime power pair.
k + (0, 2m), m >= 1, being an admissible pattern for prime pairs has high density.
k + (0, 2m-1), m >= 1, being a non-admissible pattern for prime pairs, has low density [the only possible pairs are (2^a - 2m-1, 2^a) or (2^a, 2^a + 2m-1), a >= 0.] (End)
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1270 from Daniel Forgues)
FORMULA
a(n) = A064076(n-2) for n >= 3. - Georg Fischer, Nov 02 2018
EXAMPLE
a(5) = 7 since the 5th pair of twin prime powers is (7,9), while the first four pairs are (1,3), (2,4), (3,5) and (5,7).
MAPLE
isppow := proc(n) local pf; pf := ifactors(n)[2]; if nops(pf) = 1 or n =1 then true; else false; fi; end; isA120431 := proc(n) RETURN (isppow(n) and isppow(n+2)); end; for n from 1 to 1500 do if isA120431(n) then printf("%d, ", n); fi; od; # R. J. Mathar, Dec 16 2006
MATHEMATICA
Join[{1}, Select[Range[1100], And@@PrimePowerQ/@{#, # + 2} &]] (* Vincenzo Librandi, Nov 03 2018 *)
PROG
(PARI) is(n)=if(n<4, return(n>0)); isprimepower(n) && isprimepower(n+2) \\ Charles R Greathouse IV, Apr 24 2015
(Magma) [1] cat [n: n in [2..1200] | IsPrimePower(n) and IsPrimePower(n+2)]; // Vincenzo Librandi, Nov 03 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Greg Huber, Jul 13 2006
EXTENSIONS
More terms from R. J. Mathar, Dec 16 2006
STATUS
approved