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.

Showing 1-2 of 2 results.

A071901 n-th decimal digit of the fractional part of the square root of the n-th prime.

Original entry on oeis.org

4, 3, 6, 7, 2, 1, 6, 4, 3, 1, 3, 8, 8, 0, 4, 2, 7, 4, 9, 3, 1, 4, 2, 0, 4, 1, 8, 6, 4, 9, 8, 8, 1, 4, 3, 4, 0, 8, 4, 1, 0, 2, 8, 6, 3, 2, 3, 7, 4, 7, 6, 6, 2, 5, 0, 1, 2, 3, 1, 3, 7, 4, 4, 7, 7, 4, 3, 6, 9, 6, 1, 2, 1, 9, 8, 9, 4, 2, 9, 9, 3, 5, 6, 9, 0, 4, 9, 3, 8, 6, 9, 6, 3, 6, 4, 2, 6, 3, 5, 9, 3, 7, 8, 9, 6
Offset: 1

Views

Author

Roger L. Bagula, Jun 12 2002

Keywords

Comments

Regarded as a decimal fraction, 0.4367216431388... is likely to be an irrational number.

Examples

			sqrt(2)=1.4142135... -> the 1st decimal digit is 4;
sqrt(3)=1.7320508... -> the 2nd decimal digit is 3;
sqrt(5)=2.2360679... -> the 3rd decimal digit is 6, etc.
		

References

  • Bryan Birch, Mathematical Fallacies and Paradoxes, Dover 1982; suggested by pages 120,121 and 122

Crossrefs

Cf. A003076.

Programs

  • Maple
    A071901 := proc(n) local p; p := ithprime(n) ; Digits := p+3 ; floor(10^n*sqrt(p)) mod 10 ; end proc: seq(A071901(n),n=1..120) ; # R. J. Mathar, Nov 17 2009
  • Mathematica
    q[n_] := Mod[ Floor[10^n*Sqrt[ Prime[n]]], 10]; Table[ q[n], {n, 1, 105}]
    Table[rd=RealDigits[N[Sqrt[Prime[n]],2*n]]; rd[[1,rd[[2]]+n]],{n,10000,100000,10000}] (* Zak Seidov, Nov 17 2009 *)
    ndd[n_]:=Module[{rd=RealDigits[Sqrt[Prime[n]],10,Prime[n]]}, Drop[ rd[[1]], rd[[2]]][[n]]]; Array[ndd,110]
  • PARI
    A071901(n) = {local(r,x,d);r=sqrtint(prime(n));x=100*(prime(n)-r^2);
    for(digits=1, n, d=0; while((20*r+d)*d <= x, d++);
    d--; /* while loop overshoots correct digit */
    x=100*(x-(20*r+d)*d); r=10*r+d); d} \\ Michael B. Porter, Dec 11 2009

Formula

a(n) = floor(10^n*sqrt(prime(n)))-10*floor(10^(n-1)*sqrt(prime(n))).

Extensions

Edited by Robert G. Wilson v and Henry Bottomley, Jun 13 2002

A187765 The (n-1)th decimal place of the fractional part of the square root of n.

Original entry on oeis.org

0, 4, 3, 0, 0, 8, 1, 1, 0, 0, 3, 3, 3, 9, 1, 0, 5, 4, 2, 8, 8, 5, 4, 6, 0, 1, 2, 7, 5, 0, 8, 7, 2, 3, 0, 0, 2, 2, 7, 9, 4, 0, 6, 0, 7, 3, 0, 4, 0, 7, 3, 2, 4, 8, 8, 6, 9, 0, 7, 4, 3, 5, 7, 0, 2, 3, 3, 9, 8, 7, 5, 7, 9, 6, 4, 6, 3, 4, 9, 5, 0, 3, 5, 0, 7, 0, 2
Offset: 1

Views

Author

Ruskin Harding, Jan 04 2013

Keywords

Comments

If n=1 then the term is the first digit before the decimal point. If the square root of n is a whole number then the term is 0.

Examples

			If n=2, sqrt(2)=1.41421356 approx., the 1st(2-1) decimal place of which is 4 so the 2nd term is 4. If n=3, sqrt(3)=1.73205081 approx., the 2nd(3-1) decimal place of which is 3 so the 3rd term is 3.
		

Crossrefs

Cf. A003076 (n-th digit after decimal point of square root of n).

Programs

  • Mathematica
    Join[{0}, Table[RealDigits[Sqrt[n] - Floor[Sqrt[n]], 10, n, -1][[1, -2]], {n, 2, 87}]]
  • Python
    for n in range(1,16):
        x=str(n**0.5)
        for i in range(n):
            x=x+"0"
        if n==1:
            r=str(x[-1])
        else:
            r=r+","+str(x[n])
        if n==15:
            print(r)
Showing 1-2 of 2 results.