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.

A072858 Primes p such that the period of the decimal expansion of 1/p is a square.

Original entry on oeis.org

2, 3, 5, 17, 101, 163, 257, 577, 883, 1297, 1801, 3137, 3529, 5477, 7057, 7351, 8929, 9397, 11831, 12101, 13457, 13553, 14401, 15361, 15377, 15973, 19841, 20809, 21401, 21601, 23549, 24337, 25601, 29401, 30977, 33301, 33751, 33857, 38237
Offset: 1

Views

Author

Benoit Cloitre, Jul 26 2002

Keywords

Examples

			The period of 1/17 = 0.05882352941176470588... is 16 = 4^2, hence 17 is in the sequence.
The period of 1/163 = 81 = 9^2.
		

Crossrefs

Cf. A002371.

Programs

  • Mathematica
    Select[Prime[Range[4000]], IntegerQ @ Sqrt[Length[RealDigits[1/#][[1, 1]]]] &] (* Amiram Eldar, May 21 2022 *)
  • PARI
    (a(n)=if(n<4,n==2,znorder(Mod(10, prime(n))))); for(n=1,1000,if(issquare(a(n))==1,print1(prime(n),","))) /* Thanks to Michael Somos for improvement of the PARI program */