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.

A072205 a(n) = (p^2 - p + 2)/2 for p = prime(n); number of squares modulo p^2.

Original entry on oeis.org

2, 4, 11, 22, 56, 79, 137, 172, 254, 407, 466, 667, 821, 904, 1082, 1379, 1712, 1831, 2212, 2486, 2629, 3082, 3404, 3917, 4657, 5051, 5254, 5672, 5887, 6329, 8002, 8516, 9317, 9592, 11027, 11326, 12247, 13204, 13862, 14879, 15932, 16291, 18146, 18529
Offset: 1

Views

Author

Robert G. Wilson v, Jul 03 2002

Keywords

Comments

Second terms of triple Peano sequence A071988. [Robert G. Wilson v, Jul 03 2002]
Positions of primes in A075383: A000040(n) = A075383(a(n)). [Reinhard Zumkeller, Jun 22 2009]
Number of different squares modulo p^2, for p ranging over the primes. Proof: the p multiples of p (0, p, 2p...) have the same square: 0 mod p^2. The other elements have the same square iff they are opposite: x^2 == y^2 (mod p^2) iff (x - y)(x + y) == 0 (mod p^2) iff x == y (mod p) or x == -y (mod p) or 2y == 0 (mod p). So the (p^2 - p) non-p-multiples account for (p^2 - p)/2 different squares and the p-multiples for 1 extra square, giving a total of (p^2 - p + 2)/2. [Bert Seghers, Dec 21 2011]
From Jianing Song, Apr 13 2019: (Start)
For k coprime to prime(n), k^a(n) == +-k (mod prime(n)^2).
For every integer k, k^(2a(n)) == k^2 (mod prime(n)^2). (End)

Crossrefs

Programs

  • Mathematica
    seq[n_Integer?Positive] := Module[{fn01 = 1, fn10 = 1, fnout = 1}, Do[{fn10, fn01, fnout} = {fn10 + 1, fn01 + fn10, fn01 + fnout}, {n - 1}]; {fn10, fn01, fnout}]; Ar = Flatten[ Table[ seq[ Prime[n]], {n, 1, 50}]]; a = {}; Do[a = Append[a, Ar[[n]]], {n, 2, 150, 3}]; a
  • PARI
    a(n)=binomial(prime(n),2)+1 \\ Charles R Greathouse IV, Jan 11 2012
  • Sage
    [(p^2 - p + 2)/2 for p in prime_range(200)]
    

Formula

a(n) = A008837(n) + 1.
a(n) = A000124(A000040(n)) by definition [Bert Seghers, Jan 01 2012]

Extensions

Name edited by Bert Seghers, Jan 01 2012