cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A283004 Number of primes of the form n^4 + k^4 (A002645) with 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 3, 2, 2, 2, 3, 0, 3, 2, 2, 4, 4, 3, 6, 4, 2, 2, 5, 5, 3, 7, 3, 5, 5, 5, 2, 6, 3, 10, 3, 5, 8, 5, 6, 4, 9, 6, 9, 3, 6, 9, 8, 4, 6, 8, 7, 6, 13, 8, 6, 7, 5, 7, 9, 4, 8, 14, 3, 7, 7, 6, 7, 10, 9, 4, 14, 5, 10, 13, 5, 10, 9, 6, 14, 6, 8, 12, 11, 7, 13, 10, 14, 9, 15, 7
Offset: 1

Views

Author

Robert G. Wilson v and Altug Alkan, Feb 26 2017

Keywords

Examples

			a(4) = 2 because 4^4 + 1^4 = 257 and 4^4 + 3^4 = 337 are prime numbers.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{b = Mod[n, 2] + 1, c = 0}, While[b < n, If[ Mod[n^4 + b^4, 16] == 1 && PrimeQ[n^4 + b^4], c++]; b++]; c]; f[1] = 1; Array[f, 90]
  • PARI
    a(n) = if(n==1, 1, sum(k=1, n-1, isprime(n^4+k^4)));
    
  • PARI
    first(n)=my(v=vector(n),n4); for(N=1,n, n4=N^4; forstep(k=N%2+1,N,2, if(isprime(n4+k^4), v[N]++))); v[1]++; v \\ Charles R Greathouse IV, Feb 27 2017