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-3 of 3 results.

A014777 Position of the start of the first occurrence of n after the decimal point in Pi = 3.14159265358979323846264338327950288...

Original entry on oeis.org

32, 1, 6, 9, 2, 4, 7, 13, 11, 5, 49, 94, 148, 110, 1, 3, 40, 95, 424, 37, 53, 93, 135, 16, 292, 89, 6, 28, 33, 186, 64, 137, 15, 24, 86, 9, 285, 46, 17, 43, 70, 2, 92, 23, 59, 60, 19, 119, 87, 57, 31, 48, 172, 8, 191, 130, 210, 404, 10, 4, 127, 219, 20, 312, 22, 7, 117, 98, 605
Offset: 0

Views

Author

Paul Simon (paulsimn(AT)microtec.net) and Simon Plouffe

Keywords

Comments

This is A037008(1), A037000(1), A037001(1), A037002(1), A037003(1), A037004(1), A037005(1), A036974(1), A037006(1), A037007(1) etc.

Examples

			In the decimal expansion of Pi, the string "0" is found at position 32 counting from the first digit after the decimal point. The string "1" is found at position 1, the string "2" at position 6, the string "3" at position 9, etc.
		

Crossrefs

Programs

  • Magma
    k := 700; R := RealField(k); [ Position(IntegerToString(Round(10^k*(-3 + Pi(R)))), IntegerToString(n)) : n in [0..68] ]; /* Klaus Brockhaus, Feb 15 2007 */
    
  • Mathematica
    Table[-1 + SequencePosition[#, IntegerDigits@ n][[1, 1]], {n, 0, 68}] &@ First@ RealDigits@ N[Pi, 10^4] (* Michael De Vlieger, Aug 10 2016, Version 10.1 *)
  • PARI
    M14777=Map(); A014777(n)={iferr(mapget(M14777, n), E, my(i=if(n>9, A014777(n\10), 1), d=if(n, digits(n), [0]), j); while(i++, j=#d; until(!j, d[j]==A000796(i+j--) || next(2)); break); mapput(M14777, n, i--); i)} \\ M. F. Hasler, Jun 21 2022
    
  • Python
    from mpmath import mp
    def A014777(n):
        if not (i := A014777.pos.get(n, 0)):
            d = str(n); s = 2 # starting position for search
            while (i := A014777.pi.find(d, s)) < 1:
                s = max(len(A014777.pi) - len(d), 2)
                with mp.workdps(s + 99 if s < 500 else s*6//5): # new precision
                    A014777.pi = str(mp.pi - 5/mp.mpf(10)**mp.dps) # don't round
            i -= 1; A014777.pos[n] = i
        return i
    A014777.pi = ''; A014777.pos = {} # M. F. Hasler, Jun 21 2022

Extensions

More terms from Klaus Brockhaus, Feb 15 2007

A307463 a(n) is the digit after the appearance of n in the decimal numbers of Pi after all the previous natural numbers of n have already appeared except for 0, and without overlap.

Original entry on oeis.org

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

Views

Author

Marc Bofill Janer, Apr 09 2019

Keywords

Comments

All terms appear in the decimal expansion of Pi.

Examples

			See the first decimal digits of Pi for the examples:
3.(1)4159(2)65(3)589793238(4)62643383279(5)0288...
In parentheses the first appearing of natural numbers after all smaller natural numbers have already appeared.
- FIRST ELEMENT a(1):
For n=1, the first '1' appears in the first decimal place of Pi, and the next decimal digit is '4', so a(1)=4.
- DIGIT POSITION:
For n=4, although the first 4 appears in the 2 decimal place, not all the previous natural numbers of 4 have appeared, so, after 1, 2, and 3 have appeared (in this order), then, a(4) will be the next digit after the next 4. So a(4)=6.
- N WITH MORE THAN 1 DIGIT:
In the decimal digits of Pi: ...50284(10)270193852(11)05...
For n with more than 1 digit, a(n) is, after all the previous natural numbers have appeared, the next digit after all the digits of n have appeared consecutively. Example: a(10)=2, a(11)=0.
- NO OVERLAP:
In the decimal digits of Pi: ...52230825(33)44685035...730359825(34)904...
Example: for n=33, a(33)=4, but, as there is no overlap, the '3' cannot be used again with the '4' for n=34, so a(34) is defined by the next 34: a(34)=9.
		

Crossrefs

Programs

  • PARI
    lista(nn, t=10^5) = {default(realprecision, t); my(d, k=1, v=digits(floor(Pi*10^t))); for(n=1, nn, d=digits(n); while(v[k..k+#d-1]!=d, k++); k+=#d; print1(v[k], ", ")); } \\ Jinyuan Wang, Feb 18 2021

Extensions

More terms from Jinyuan Wang, Feb 18 2021

A317488 a(n) is the position of the first occurrence of n > a(n-1) after the decimal point in e = 2.71828182845904523...

Original entry on oeis.org

2, 4, 17, 25, 29, 31, 36, 86, 107, 195, 200, 370, 687, 853, 880, 899, 961, 963, 1013, 1153, 1161, 1235, 1263, 1291, 1325, 1347, 1357, 1399, 1444, 1451, 1798, 1846, 2067, 2191, 2258, 2305, 2332, 2356, 2370, 2487, 2516, 2571, 2578, 2690, 2694, 2807, 2926, 2956, 3012
Offset: 1

Views

Author

Philipp O. Tsvetkov, Jul 29 2018

Keywords

Examples

			Moving always to the right in the decimal expansion of e, the string "1" is found at position 2 counting from the first digit after the decimal point, the string "2" is found at position 4, the string "3" at position 17, the string "4" at position 25, etc.
		

Crossrefs

Programs

  • Mathematica
    p = ToString[FromDigits[RealDigits[N[E - 2, 2600]][[1]]]]; lst = {0}; Do[
    a = StringPosition[p, ToString[n], 1][[1, 1]]; AppendTo[lst, a + lst[[-1]]];
    p = StringDrop[p, a], {n, 29}]; Rest[lst]
Showing 1-3 of 3 results.