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.

A282849 Number of divisors k of n such that (n + k^2)/k is a prime.

Original entry on oeis.org

1, 2, 0, 2, 0, 4, 0, 0, 0, 4, 0, 4, 0, 0, 0, 2, 0, 4, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 8, 0, 0, 0, 2, 0, 4, 0, 0, 0, 4, 0, 8, 0, 0, 0, 2, 0, 2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 8, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 0, 4, 0, 0, 0, 2, 0, 8, 0, 0, 0, 4, 0, 4, 0, 0, 0, 4, 0, 6
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 24 2017

Keywords

Comments

Except for the single case of a(1)=1 all terms are even. - Robert G. Wilson v, Feb 25 2017
First occurrence of 2k: 3, 2, 6, 90, 30, 390, 690, 420, 210, 4290, 3990, 8778, 2310, 3570, 4830, 11550, 38850, 84630, 66990, 79170, 39270, 30030, 51870, 46410, 43890, ..., . - Robert G. Wilson v, Feb 25 2017

Examples

			a(6) = 4 because (6 + 1^2)/1 = 7 is prime, (6 + 2^2)/2 = 5 is prime, (6 + 3^2)/3 = 5 is prime, (6 + 6^2)/6 = 7 is prime, where 1, 2, 3 and 6 are divisors of 6.
		

Crossrefs

Cf. A088627 (number of divisors k of n such that (n + 2*k^2)/k is prime), A047255.

Programs

  • Mathematica
    f[n_] := Block[{d = Divisors@ n}, Length@ Select[d, PrimeQ[(n + #^2)/#] &]]; Array[f, 105] (* Robert G. Wilson v, Feb 25 2017 *)
    Table[DivisorSum[n, 1 &, PrimeQ[(n + #^2)/#] &], {n, 105}] (* Michael De Vlieger, Nov 15 2017 *)
  • PARI
    a(n) = sumdiv(n, k, isprime((n+k^2)/k)); \\ Michel Marcus, Feb 26 2017

Formula

a(1) = 1; for n > 0: a(2n) = 2*A088627(n), a(2n + 1) = 0.