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

A038546 Numbers n such that n-th Fibonacci number has initial digits n.

Original entry on oeis.org

0, 1, 5, 43, 48, 53, 3301, 48515, 348422, 406665, 1200207, 6698641, 190821326, 2292141445, 257125021372, 5843866639660, 45173327533483, 46312809996150, 59358981837795, 129408997210988, 1450344802530203, 5710154240910003
Offset: 1

Views

Author

Keywords

Comments

The Mathematica coding used by Robert G. Wilson v implements Binet's Fibonacci number formula as suggested by David W. Wilson and incorporates Benoit Cloitre's use of logarithms to achieve a further increase in speed.
Fixed points of A020344. - Alois P. Heinz, Jul 08 2022

Examples

			a(3)=43 since 43rd Fibonacci number starts with 43 -> {43}3494437.
Fibonacci(53) is 53316291173, which begins with 53, so 53 is a term in the sequence.
		

Crossrefs

Programs

  • Mathematica
    a = N[ Log[10, Sqrt[5]/5], 24]; b = N [Log[10, GoldenRatio], 24]; Do[ If[ IntegerPart[10^FractionalPart[a + n*b]*10^Floor[ Log[10, n]]] == n, Print[n]], {n, 225000000}] (* Robert G. Wilson v, May 09 2005 *)
    (* confirmed with: *) fQ[n_] := (FromDigits[ Take[ IntegerDigits[ Fibonacci[n]], Floor[ Log[10, n] + 1]]] == n)
  • PARI
    /* To obtain terms > 5: */ a=(1+sqrt(5))/2; b=1/sqrt(5); for(n=1,3500, if(n==floor(b*(a^n)/10^( floor(log(b *(a^n))/log(10))-floor(log(n)/log(10)))),print1(n,","))) \\ Benoit Cloitre, Feb 27 2002

Formula

n>5 is in the sequence if a=(1+sqrt(5))/2 b=1/sqrt(5) and n==floor(b*(a^n)/10^(floor((log(b) +n*log(a))/log(10))-floor(log(n)/log(10))) ). - Benoit Cloitre, Feb 27 2002

Extensions

Term a(6) from Patrick De Geest, Oct 15 1999
a(7) from Benoit Cloitre, Feb 27 2002
a(8)-a(11) from Robert G. Wilson v, May 09 2005
a(12) from Robert G. Wilson v, May 11 2005
More terms from Robert Gerbicz, Aug 22 2006

A020345 Smallest Fibonacci number beginning with n.

Original entry on oeis.org

0, 1, 2, 3, 4181, 5, 610, 75025, 8, 987, 10946, 1134903170, 121393, 13, 144, 1597, 165580141, 17711, 1836311903, 196418, 20365011074, 21, 225851433717, 233, 24157817, 2584, 267914296, 27777890035288, 28657, 2971215073, 308061521170129, 317811
Offset: 0

Views

Author

Keywords

Comments

The graph of the indices A020344 is much more interesting. - T. D. Noe, Apr 02 2014
a(1382) is the first term with > 1000 digits (1004). - Michael S. Branicky, Jul 08 2022

Examples

			a(4) = 4181 is a Fibonacci number starting with 4.
		

Crossrefs

Programs

  • Mathematica
    nn = 31; t = tn = Table[0, {nn}]; found = 0; n = 0; While[found < nn, n++;  f = Fibonacci[n]; d = IntegerDigits[f]; i = 1; While[i <= Length[d], k = FromDigits[Take[d, i]]; If[k > nn, Break[]]; If[t[[k]] == 0, t[[k]] = f; tn[[k]] = n; found++]; i++]]; t = Join[{0}, t] (* T. D. Noe, Apr 02 2014 *)
  • Python
    def aupton(nn):
        ans, f, g, k = dict(), 0, 1, 0
        while len(ans) < nn+1:
            sf = str(f)
            for i in range(1, len(sf)+1):
                if int(sf[:i]) > nn:
                    break
                if sf[:i] not in ans:
                    ans[sf[:i]] = f
            f, g, k = g, f+g, k+1
        return [int(ans[str(i)]) for i in range(nn+1)]
    print(aupton(31)) # Michael S. Branicky, Jul 08 2022

Formula

a(n) = A000045(A020344(n)).

A023183 a(n) = least k such that Fibonacci(k) ends with n, or -1 if there are none.

Original entry on oeis.org

0, 1, 3, 4, 9, 5, 21, 14, 6, 11, 15, 22, 216, 7, 111, 130, 168, 37, 27, 112, 60, 8, 117, 64, 198, 25, 99, 136, 204, 29, 105, 88, 174, 13, 9, 70, 222, 43, 93, 172, 30, 41, 63, 124, 12, 55, 21, 154, 186, 49, 75, 148, 36, 67, 129, 10, 162, 23, 87, 118, 180, 61, 57, 166, 72, 20
Offset: 0

Views

Author

Keywords

Comments

It appears that if n is greater than 99 and congruent to 4 or 6 (mod 8) then there is no Fibonacci number ending in that n. - Jason Earls, Jun 19 2004
This is because there is no Fibonacci number == 4 or 6 (mod 8). - Robert Israel, Sep 11 2020

Crossrefs

Programs

  • Maple
    V:= Array(0..999,-1):
    V[0]:= 0: u:= 1: v:= 0:
    for n from 1 to 1500 do
      t:= v;
      v:= u+v mod 1000;
      u:= t;
      if V[v] = -1 then V[v]:= n fi;
      if V[v mod 100] = -1 then V[v mod 100] := n fi;
      if V[v mod 10] = -1 then V[v mod 10]:= n fi;
    od:
    seq(V[i],i=0..999); # Robert Israel, Sep 11 2020
  • Mathematica
    d[n_]:=IntegerDigits[n]; Table[j=0; While[Length[d[Fibonacci[j]]]<(le=Length[y=d[n]]), j++]; i=j; While[Take[d[Fibonacci[i]],-le]!=y,i++]; i,{n,0,65}] (* Jayanta Basu, May 18 2013 *)
  • Python
    from itertools import count
    def A023183(n):
        if n < 2: return n
        if n > 99 and n%8 in {4, 6}: return -1
        k, f, g, s = 3, 1, 2, str(n)
        pow10, seen = 10**len(s), set()
        while (f, g) not in seen:
            seen.add((f, g))
            if g%pow10 == n:
                return k
            f, g, k = g, (f+g)%pow10, k+1
        return -1
    print([A023183(n) for n in range(66)]) # Michael S. Branicky, Jun 27 2024

A023184 Least Fibonacci number ending with n.

Original entry on oeis.org

0, 1, 2, 3, 34, 5, 10946, 377, 8, 89, 610, 17711, 619220451666590135228675387863297874269396512, 13, 70492524767089125814114, 659034621587630041982498215, 57602132235424755886206198685365216, 24157817, 196418, 114059301025943970552219, 1548008755920
Offset: 0

Views

Author

Keywords

Comments

The Fibonacci index of the 12th to 25th terms respectively are 216, 7, 111, 130, 168, 37, 27, 112, 90, 8, 183, 286, 252 and 25.

Examples

			a(11) = 17711 is the smallest Fibonacci number ending in 11.
		

Crossrefs

Programs

  • Maple
    with(combinat):for n from 1 to 40 do e := 1; g := ceil(log(n+1)/log(10)-0.00001): while((fibonacci(e) mod 10^g)n) do e := e+1:end do: q[n] := fibonacci(e):end do:seq(q[i],i=1..40);
  • Mathematica
    d[n_]:=IntegerDigits[n]; Table[j=0; While[Length[d[Fibonacci[j]]]<(le=Length[y=d[n]]), j++]; i=j; While[Take[d[x=Fibonacci[i]],-le]!=y,i++]; x,{n,0,20}] (* Jayanta Basu, May 18 2013 *)

A355438 Lucas(a(n)) is least Lucas number beginning with n.

Original entry on oeis.org

1, 0, 2, 3, 13, 23, 4, 14, 19, 24, 5, 10, 15, 39, 20, 25, 49, 6, 11, 35, 59, 16, 64, 21, 45, 69, 26, 50, 7, 31, 55, 12, 36, 60, 17, 151, 41, 65, 22, 156, 46, 70, 27, 94, 51, 252, 8, 32, 166, 56, 190, 13, 281, 37, 305, 61, 18, 85, 42, 109, 310, 66, 267, 23, 224, 47, 181, 71, 138, 339
Offset: 1

Views

Author

Michel Marcus, Jul 02 2022

Keywords

Crossrefs

Programs

  • PARI
    L(n) = real((2 + quadgen(5)) * quadgen(5)^n); \\ A000032
    isok(k, dn) = my(dk=digits(L(k))); if (#dk >= #dn, Vec(dk, #dn) == dn);
    a(n) = my(k=0, dn=digits(n)); while (!isok(k, dn), k++); k;
    
  • Python
    def aupton(nn):
        ans, f, g, k = dict(), 2, 1, 0
        while len(ans) < nn:
            sf = str(f)
            for i in range(1, len(sf)+1):
                if int(sf[:i]) > nn:
                    break
                if sf[:i] not in ans:
                    ans[sf[:i]] = k
            f, g, k = g, f+g, k+1
        return [int(ans[str(i)]) for i in range(1, nn+1)]
    print(aupton(70)) # Michael S. Branicky, Jul 08 2022

Formula

Trivially a(n) >= log_phi(n-1) for n > 1. Probably upper bounds are obtainable using the theory of linear forms in logarithms. - Charles R Greathouse IV, Jul 08 2022

A355439 Smallest Lucas number beginning with n.

Original entry on oeis.org

1, 2, 3, 4, 521, 64079, 7, 843, 9349, 103682, 11, 123, 1364, 141422324, 15127, 167761, 17393796001, 18, 199, 20633239, 2139295485799, 2207, 23725150497407, 24476, 2537720636, 263115950957276, 271443, 28143753123, 29, 3010349, 312119004989, 322, 33385282, 3461452808002, 3571
Offset: 1

Views

Author

Michel Marcus, Jul 02 2022

Keywords

Comments

a(1382) is the first term with > 1000 digits (1156). - Michael S. Branicky, Jul 08 2022

Crossrefs

Programs

  • PARI
    L(n) = real((2 + quadgen(5)) * quadgen(5)^n); \\ A000032
    isok(k, dn) = my(dk=digits(L(k))); if (#dk >= #dn, Vec(dk, #dn) == dn);
    a(n) = my(k=0, dn=digits(n)); while (!isok(k, dn), k++); L(k);
    
  • Python
    def aupton(nn):
        ans, f, g, k = dict(), 2, 1, 0
        while len(ans) < nn:
            sf = str(f)
            for i in range(1, len(sf)+1):
                if int(sf[:i]) > nn:
                    break
                if sf[:i] not in ans:
                    ans[sf[:i]] = f
            f, g, k = g, f+g, k+1
        return [int(ans[str(i)]) for i in range(1, nn+1)]
    print(aupton(35)) # Michael S. Branicky, Jul 08 2022

A124100 Sum_(x^i*y^j*z^k) with i + j + k = m and (x, y, z) = the primitive Pythagorean triple (8, 15, 17).

Original entry on oeis.org

1, 40, 1089, 25160, 531521, 10625640, 204744769, 3844391560, 70827391041, 1286290883240, 23101397290049, 411249127989960, 7269184506192961, 127745926316548840, 2234231991096868929, 38920247688751940360
Offset: 0

Views

Author

Keywords

Examples

			a(2) = 1089 because x^2 + y^2 + z^2 + x*y + x*z + y*z = 8^2 + 15^2 + 17^2 + 8*15 + 8*17 + 15*17 = 1089 and x^2 + y^2 = z^2.
		

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 196.

Crossrefs

Programs

  • Maple
    seq(sum(8^(m-n)*sum(15^p*17^(n-p),p=0..n),n=0..m),m=0..N);
  • Mathematica
    LinearRecurrence[{40,-511,2040},{1,40,1089},30] (* Harvey P. Dale, May 25 2025 *)

Formula

a(m) = (x^(m+2)*(z-y) + y^(m+2)*(x-z) + z^(m+2)*(y-x))/((x-y)*(y-z)*(z-x)).
From Chai Wah Wu, Sep 24 2016: (Start)
a(n) = 40*a(n-1) - 511*a(n-2) + 2040*a(n-3) for n > 2.
G.f.: 1/((1 - 8*x)*(1 - 15*x)*(1 - 17*x)). (End)
a(n) = 2^(3*n+6)/63 - 15^(n+2)/14 + 17^(n+2)/18. - Vaclav Kotesovec, Sep 25 2016

A374026 a(n) = the smallest k such that Fibonacci(k) begins and ends with n, where Fibonacci(k) > n, or -1 if there are none.

Original entry on oeis.org

22, 114, 124, 72, 10, 39, 116, 207, 169, 5715, 2428, 5634, 2366, 189, 2620, 4668, 3137, 2673, 5812, 12090, 721, 11583, 20086, 3798, 1975, 999, 10636, 846, 2071, 9105, 1162, 2076, 8287, 11091, 2770, 2928, 12943, 8493, 172, 2220, 5359, 4737, 28126, 11838, 10460, 7479, 10996
Offset: 1

Views

Author

Gonzalo Martínez, Jun 26 2024

Keywords

Comments

Since the smallest number beginning and ending with n is the same n, the condition that Fibonacci(k) > n is imposed. Partial overlap of the start and end is allowed, but not full overlap.

Examples

			As Fibonacci(22) = 17711 is the smallest Fibonacci number greater than 1 that begins and ends with 1, a(1) = 22.
As Fibonacci(10) = 55 is the smallest Fibonacci number greater than 5 that begins and ends with 5, a(5) = 10.
		

Crossrefs

Programs

  • PARI
    isok(s,t) = my(ss=strsplit(s, t)); (#ss >= 3) && (ss[1]=="") && (ss[#ss]=="");
    a(n) = my(k=7); while(!isok(Str(fibonacci(k)), Str(n)), k++); k; \\ Michel Marcus, Jun 26 2024
    
  • Python
    # uses A023183() in A023183
    from itertools import count
    def a(n):
        if A023183(n) == -1:
            return -1
        f, g, s = 1, 2, str(n)
        pow10 = 10**len(s)
        for k in count(3):
            if g%pow10 == n:
                sfib = str(g)
                if g > n and sfib.startswith(s):
                    return k
            f, g = g, f+g
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Jul 03 2024

Formula

a(n) >= max{A023183(n), A020344(n)} except that a(n) = -1 when A023183(n) = -1. - Michael S. Branicky, Jun 27 2024

Extensions

More terms from Michel Marcus, Jun 26 2024
Showing 1-8 of 8 results.