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.

A185679 Number of digits in decimal expansion of n^2.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5
Offset: 0

Views

Author

Carmine Suriano, Feb 23 2011

Keywords

Examples

			a(33)=4 since 33^2=1089 has 4 digits.
		

Crossrefs

Cf. A055642.

Programs

  • Mathematica
    Table[Length[IntegerDigits[n^2]], {n, 0, 100}]
    Join[{1},IntegerLength[Range[100]^2]] (* Harvey P. Dale, Sep 17 2019 *)
  • PARI
    concat([1], for(n=1,50, print1(1 + floor(log(n^2)/log(10)), ", "))) \\ G. C. Greubel, Jul 10 2017
    
  • Python
    def A185679(n): return len(str(n**2)) # Chai Wah Wu, Mar 15 2023

Formula

a(n) = 1 + floor(log(10, n^2)) for n>0.