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.

A177715 The position within sqrt(n) at which n first occurs.

Original entry on oeis.org

0, 4, 2, 0, 36, 38, 4, 1, 0, 88, 19, 51, 221, 318, 48, 0, 11, 98, 24, 143, 60, 40, 8, 108, 0, 144, 9, 267, 32, 188, 183, 154, 370, 44, 107, 0, 117, 25, 10, 148, 145, 107, 4, 234, 48, 298, 252, 31, 0, 102, 211, 119, 178, 352, 118, 224, 63, 9, 107, 103, 239, 130, 94, 0, 16
Offset: 1

Views

Author

Gil Broussard, May 12 2010

Keywords

Comments

Determine position from the decimal point, and define a(n)=0 for perfect squares (A000290).

Examples

			a(1)=0 because 1 is a perfect square.
a(2)=4 because the first "2" occurs at position 4 in "1.41421356...".
a(5)=36 because the first "5" occurs at position 36 in "2.236067977499789696409173668731276235"
		

Crossrefs

Cf. A000290.

Programs

  • Mathematica
    max = 500; a[n_] := If[IntegerQ @ Sqrt[n], 0, SequencePosition[(r = RealDigits[ FractionalPart @ Sqrt[n], 10, max])[[1]], IntegerDigits[n]][[1, 1]] - r[[2]]]; Array[a, 100] (* Amiram Eldar, Sep 25 2020 *)