OFFSET
1,1
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..110
EXAMPLE
PROG
(PARI) d(k) = 2*prime(k)-prime(k+1);
isok(n) = (d(n) == d(n+1)) && (d(n+1) == d(n+2)) && (d(n+2) == d(n+3)); \\ Michel Marcus, May 29 2015
(Perl) use Math::Prime::Util::PrimeArray; tie my @prime, "Math::Prime::Util::PrimeArray"; sub d { 2*$prime[$_[0]-1] - $prime[$_[0]] } for (1..1e6) { my $dk=d($_); say if d($_+1)==$dk && d($_+2)==$dk && d($_+3)==$dk } # Dana Jacobsen, May 31 2015
(Perl) use ntheory ":all"; { my @prime; sub d { 2*$prime[$_[0]-1] - $prime[$_[0]] } sub list { my $n=shift; @prime=@{primes(nth_prime($n+5))}; my @d=map{d($_)}1..4; my @list; for (1..$n) { push @list, $_ if $d[0]==$d[1] && $d[0]==$d[2] && $d[0]==$d[3]; @d=(@d[1..3], d($_+4)) } @list; } } say join ", ", list(1e6); # Dana Jacobsen, May 31 2015
(Haskell)
a257892 n = a257892_list !! (n-1)
a257892_list = map a258432 $ filter ((== 4) . a258383) [1..]
-- Reinhard Zumkeller, May 31 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, May 14 2015
STATUS
approved