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-10 of 16 results. Next

A094373 Expansion of (1-x-x^2)/((1-x)*(1-2*x)).

Original entry on oeis.org

1, 2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649, 4294967297, 8589934593
Offset: 0

Views

Author

Paul Barry, Apr 28 2004

Keywords

Comments

Partial sum of 1,1,1,2,4,8,...
Binomial transform of abs(A073097).
Binomial transform is A094374.
Partial sums are in A006127. - Paul Barry, Aug 05 2004
An elephant sequence, see A175654. For the corner squares four A[5] vectors, with decimal values 2, 8, 32 and 128, lead to this sequence. For the central square these vectors lead to the companion sequence A011782. - Johannes W. Meijer, Aug 15 2010
This sequence has a(0) = 1 and for all n > 0, a(n) = 2^(n-1)+1. Consequently 2*a(n) >= a(n+1) for all n > 0 and the sequence is complete. - Frank M Jackson, Jan 29 2012
Row lengths of the triangle in A198069. - Reinhard Zumkeller, May 26 2013
Take A007843 and count the repeated values. The result is 1,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,.... Build a third sequence, where a(1) = 1 and a(n) equals the length (greater than 1) of the shortest palindromic subsequence of consecutive terms of the second sequence starting with a(n) of the second sequence. The third sequence starts 1,3,5,3,9,3,5,3,17,3,5,3,9,3,5,3,33,.... Conjecturally, in the third sequence: (1) the indices of the first occurrence of each value form the present sequence and (2) for n>1, a(n) is in the a(n-1)-th position. - Ivan N. Ianakiev, Aug 20 2019

Examples

			G.f. = 1 + 2*x + 3*x^2 + 5*x^3 + 9*x^4 + 17*x^5 + 33*x^6 + 65*x^7 + ...
		

Crossrefs

Apart from the initial 1, identical to A000051.
Cf. A135225.
Column k=1 of A152977.
Row n=2 of A238016.

Programs

  • GAP
    a:=[2,3];; for n in [3..40] do a[n]:=3*a[n-1]-2*a[n-2]; od; Concatenation([1], a); # G. C. Greubel, Nov 06 2019
  • Magma
    [(2^n-0^n)/2+1: n in [0..40]]; // Vincenzo Librandi, Jun 10 2011
    
  • Magma
    R:=PowerSeriesRing(Integers(), 35); Coefficients(R!( (1-x-x^2)/((1-x)*(1-2*x)))); // Marius A. Burtea, Oct 25 2019
    
  • Maple
    1, seq((2^n - 0^n)/2 +1, n=1..40); # G. C. Greubel, Nov 06 2019
  • Mathematica
    CoefficientList[Series[(1-x-x^2)/((1-x)*(1-2*x)), {x, 0, 40}], x] (* or *) Join[{1}, LinearRecurrence[{3, -2}, {2, 3}, 40]] (* Vladimir Joseph Stephan Orlovsky, Jan 22 2012 *)
    a[ n_]:= If[n<0, 0, 1 + Quotient[2^n, 2]]; (* Michael Somos, May 26 2014 *)
    a[ n_]:= SeriesCoefficient[(1-x-x^2)/((1-x)(1-2x)), {x, 0, n}]; (* Michael Somos, May 26 2014 *)
    LinearRecurrence[{3,-2},{1,2,3},40] (* Harvey P. Dale, Aug 09 2015 *)
  • PARI
    a(n)=2^n\2+1 \\ Charles R Greathouse IV, Apr 05 2013
    
  • PARI
    Vec((1-x-x^2)/((1-x)*(1-2*x))+O(x^40)) \\ Charles R Greathouse IV, Apr 05 2013
    
  • Sage
    [(2^n - 0^n)/2 + 1 for n in (0..40)] # G. C. Greubel, Nov 06 2019
    

Formula

a(n) = (2^n - 0^n)/2 + 1.
a(n) = 3*a(n-1) - 2*a(n-2).
a(2*n) = 2*a(2*n-1) - 1, n>0.
Row sums of triangle A135225. - Gary W. Adamson, Nov 23 2007
a(n) = A131577(n) + 1. - Paul Curtz, Aug 07 2008
a(n) = 2*a(n-1) - 1 for n>1, a(0)=1, a(1)=2. - Philippe Deléham, Sep 25 2009
E.g.f.: exp(x)*(1 + sinh(x)). - Arkadiusz Wesolowski, Aug 13 2012
G.f.: G(0), where G(k)= 1 + 2^k*x/(1 - x/(x + 2^k*x/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jul 26 2013
a(n) = 2^(n-1) +1 = A000051(n-1) for n>0. - M. F. Hasler, Sep 22 2013

A046699 a(1) = a(2) = 1, a(n) = a(n - a(n-1)) + a(n-1 - a(n-2)) if n > 2.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 8, 8, 8, 9, 10, 10, 11, 12, 12, 12, 13, 14, 14, 15, 16, 16, 16, 16, 16, 17, 18, 18, 19, 20, 20, 20, 21, 22, 22, 23, 24, 24, 24, 24, 25, 26, 26, 27, 28, 28, 28, 29, 30, 30, 31, 32, 32, 32, 32, 32, 32, 33, 34, 34, 35, 36, 36, 36, 37
Offset: 1

Views

Author

Keywords

Comments

Ignoring first term, this is the meta-Fibonacci sequence for s=0. - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
Except for the first term, n occurs A001511(n) times. - Franklin T. Adams-Watters, Oct 22 2006

References

  • Sequence was proposed by Reg Allenby.
  • B. W. Conolly, "Meta-Fibonacci sequences," in S. Vajda, editor, Fibonacci and Lucas Numbers and the Golden Section. Halstead Press, NY, 1989, pp. 127-138. See Eq. (2).
  • Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 5, 1990, pp. 212-213, 1993.
  • S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Haskell
    a046699 n = a046699_list !! (n-1)
    a046699_list = 1 : 1 : zipWith (+) zs (tail zs) where
       zs = map a046699 $ zipWith (-) [2..] a046699_list
    -- Reinhard Zumkeller, Jan 02 2012
    
  • Magma
    [ n le 2 select 1 else Self(n - Self(n-1)) + Self(n-1 -Self(n-2)):n in [1..80]]; // Marius A. Burtea, Oct 17 2019
  • Maple
    a := proc(n) option remember; if n <= 1 then return 1 end if; if n <= 2 then return 2 end if; return add(a(n - i + 1 - a(n - i)), i = 1 .. 2) end proc # Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
    a := proc(n) option remember; if n <= 2 then 1 else a(n - a(n-1)) + a(n-1 - a(n-2)); fi; end; # N. J. A. Sloane, Apr 16 2014
  • Mathematica
    a[n_] := (k = 1; While[ !Divisible[(2*++k)!, 2^(n-1)]]; k); a[1] = a[2] = 1; Table[a[n], {n, 1, 72}] (* Jean-François Alcover, Oct 06 2011, after Benoit Cloitre *)
    CoefficientList[ Series[1 + x/(1 - x)*Product[1 + x^(2^n - 1), {n, 6}], {x, 0, 80}], x] (* or *)
    a[1] = a[2] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - 1 - a[n - 2]]; Array[a, 80] (* Robert G. Wilson v, Sep 08 2014 *)
  • Maxima
    a[1]:1$
    a[2]:1$
    a[n]:=a[n-a[n-1]]+a[n-1-a[n-2]]$
    makelist(a[n],n,2,60); /* Martin Ettl, Oct 29 2012 */
    
  • PARI
    a(n)=if(n<0,1,s=1;while((2*s)!%2^(n-1)>0,s++);s) \\ Benoit Cloitre, Jan 19 2007
    
  • Python
    from sympy import factorial
    def a(n):
        if n<3: return 1
        s=1
        while factorial(2*s)%(2**(n - 1))>0: s+=1
        return s
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 11 2017, after Benoit Cloitre
    

Formula

First differences seem to be A079559. - Vladeta Jovovic, Nov 30 2003. This is correct and not too hard to prove, giving the generating function x + x^2(1+x)(1+x^3)(1+x^7)(1+x^15).../(1-x). - Paul Boddington, Jul 30 2004
G.f.: x + x^2/(1-x) * Product_{n=1}^{infinity} (1 + x^(2^n-1)). - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
For n>=1, a(n)=w(n-1) where w(n) is the least k such that 2^n divides (2k)!. - Benoit Cloitre, Jan 19 2007
Conjecture: a(n+1) = a(n) + A215530(a(n) + n) for all n > 0. - Velin Yanev, Oct 17 2019
From Bernard Schott, Dec 03 2021: (Start)
a(n) <= a(n+1) <= a(n) +1.
For n > 1, if a(n) is odd, then a(n+1) = a(n) + 1.
a(2^n+1) = 2^(n-1) + 1 for n > 0.
Results coming from the 5th problem proposed during the 22nd Canadian Mathematical Olympiad in 1990 (link IMO Compendium and Doob reference). (End)

A120503 Generalized meta-Fibonacci sequence a(n) with parameters s=0 and k=3.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 27, 27, 27, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 45, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51
Offset: 1

Views

Author

Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca), Jun 20 2006

Keywords

References

  • Callaghan, Joseph, John J. Chew III, and Stephen M. Tanny. "On the behavior of a family of meta-Fibonacci sequences." SIAM Journal on Discrete Mathematics 18.4 (2005): 794-824. See T_{0,3} with initial values 0,0,1, and plotted in Fig. 1.5. This is essentially the same sequence. - N. J. A. Sloane, Apr 16 2014

Crossrefs

Programs

  • Maple
    a := proc(n)
    option remember;
    if n <= 1 then return 1 end if;
    if n <= 3 then return n end if;
    return add(a(n - i + 1 - a(n - i)), i = 1 .. 3)
    end proc
  • Mathematica
    a[n_] := a[n] = If[1 <= n <= 3, n, Sum[a[n-i+1 - a[n-i]], {i, 1, 3}]];
    Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Aug 02 2022 *)
  • PARI
    {a(n)=local(A); if(n<=3, max(0, n), A=vector(n, i, i); for(k=4, n, A[k]=A[k-A[k-1]]+A[k-1-A[k-2]]+A[k-2-A[k-3]]); A[n])} /* Michael Somos, Aug 31 2006 */
    
  • PARI
    apply( A120503(n)={my(s=sumdigits(n*=2, 3)\2); n\=3; while(s>0, s-=valuation(n++, 3)+1); n}, [1..99]) \\ M. F. Hasler, Dec 27 2019

Formula

If n = 1, a(n)=1. If 2 <= n <= 3, then a(n)=n. If n>3 then a(n)=a(n-a(n-1)) + a(n-1-a(n-2)) + a(n-2-a(n-3))
G.f.: A(z) = z / (1 - z) * prod( (1 - z^(3 * [i])) / (1 - z^[i]), i=1..infinity), where [i] = (3^i - 1) / 2.
a(n) = A007844(n)/3. - Michel Marcus, Aug 19 2013, conjectured. This is true: see the analogous sequence A007843 for a sketch of the proof. - M. F. Hasler, Dec 27 2019

A007845 Least positive integer k for which 5^n divides k!.

Original entry on oeis.org

1, 5, 10, 15, 20, 25, 25, 30, 35, 40, 45, 50, 50, 55, 60, 65, 70, 75, 75, 80, 85, 90, 95, 100, 100, 105, 110, 115, 120, 125, 125, 125, 130, 135, 140, 145, 150, 150, 155, 160, 165, 170, 175, 175, 180, 185, 190, 195, 200, 200, 205, 210, 215, 220, 225, 225, 230, 235, 240, 245
Offset: 0

Views

Author

Bruce Dearden and Jerry Metzger

Keywords

Comments

Also the smallest factorial having at least n trailing zeros. - Jud McCranie, Oct 05 2010
a(n) ~ 4n, a(n) > 4n. Every positive multiple of 5 occurs as much as the exponent of 5 in the prime factorization. - David A. Corneth, Jul 12 2016
Least k such that A027868(k) >= n. - Robert Israel, Jul 12 2016
See A007843 and A007844 for the analog for 2 and 3 instead of 5. - M. F. Hasler, Dec 27 2019

References

  • H. Ibstedt, Smarandache Primitive Numbers, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 216-229.

Crossrefs

Programs

  • Maple
    1, seq(t $ padic:-ordp(t,5), t=5..1000, 5); # Robert Israel, Jul 12 2016
  • Mathematica
    lpi[n_]:=Module[{k=1,n5=5^n},While[!Divisible[k!,n5],k++];k]; Array[ lpi,60,0] (* Harvey P. Dale, Jun 19 2012 *)
  • PARI
    a(n) = {k = 1; while (valuation(k!, 5) < n, k++); k;} \\ Michel Marcus, Aug 19 2013
    
  • PARI
    a(n) = {my(ck = 4 * n, k = 5 * floor(ck/5), t = 0); if(ck > 0, t = sum(i = 1, logint(ck,5),ck\=5)); while(t < n, k+=5; t+=valuation(k,5));max(1,k)} \\ David A. Corneth, Jul 12 2016

Formula

a(n) = 5*A228297(n) for n > 0: see A007843. - M. F. Hasler, Dec 27 2019

A007844 Least positive integer k for which 3^n divides k!.

Original entry on oeis.org

1, 3, 6, 9, 9, 12, 15, 18, 18, 21, 24, 27, 27, 27, 30, 33, 36, 36, 39, 42, 45, 45, 48, 51, 54, 54, 54, 57, 60, 63, 63, 66, 69, 72, 72, 75, 78, 81, 81, 81, 81, 84, 87, 90, 90, 93, 96, 99, 99, 102, 105, 108, 108, 108, 111, 114, 117, 117, 120, 123, 126, 126, 129, 132, 135, 135, 135
Offset: 0

Views

Author

Bruce Dearden and Jerry Metzger, R. Muller

Keywords

Comments

It appears than for n>0, a(n) is divisible by 3, and that the resulting sequence a(n)/3 is A120503 (checked up to n=1000). - Michel Marcus, Aug 19 2013. [This is true: see A007843 for the idea of the proof. - M. F. Hasler, Dec 27 2019]
Also least positive integer k for which 6^n divides k!. - Michel Marcus, Aug 20 2013

References

  • H. Ibstedt, Smarandache Primitive Numbers, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 216-229.

Crossrefs

Cf. A007843 (analog for 2), A007845 (analog for 5).
Cf. A120503 (Meta-Fibonacci, k = 3).

Programs

  • Mathematica
    Array[Block[{k = 1}, While[Mod[k!, 3^#] != 0, k++]; k] &, 67, 0] (* Michael De Vlieger, Dec 29 2019 *)
  • PARI
    a(n) = {k = 1; while (valuation(k!, 3) < n, k++); k;} \\ Michel Marcus, Aug 19 2013
    
  • PARI
    apply( A007844(n)={my(s=sumdigits(n*=2,3)\2); n-=n%3; while(s>0, s-=valuation(n+=3,3)); n+!n}, [0..99]) \\ M. F. Hasler, Dec 27 2019

Formula

a(n) = 3*A120503(n) for n > 0, cf. A007843. - M. F. Hasler, Dec 27 2019

A341680 Successive approximations up to 2^n for the 2-adic integer Sum_{k>=0} k!.

Original entry on oeis.org

0, 0, 2, 2, 10, 26, 26, 26, 26, 26, 538, 538, 2586, 6682, 14874, 31258, 64026, 129562, 129562, 391706, 915994, 1964570, 4061722, 8256026, 8256026, 8256026, 8256026, 8256026, 142473754, 410909210, 947780122, 2021521946, 4169005594, 8463972890, 8463972890, 25643842074
Offset: 0

Views

Author

Jianing Song, Feb 17 2021

Keywords

Comments

a(n) == Sum_{k>=0} k! (mod 2^n). Since k! mod 2^n is eventually zero, a(n) is well-defined.
In general, for every prime p, the p-adic integer x = Sum_{k>=0} k! is well-defined. To find the approximation up to p^n (n > 0) for x, it is enough to add k! for 0 <= k <= m and then find the remainder of the sum modulo p^n, where m = (p - 1)*(n + floor(log_p((p-1)*n))). This is because p^n divides (m+1)!

Examples

			For n = 9, since 2^9 divides 12!, we have a(9) = (Sum_{k=0..11} k!) mod 2^9 = 26.
For n = 12, since 2^12 divides 16!, we have a(12) = (Sum_{k=0..15} k!) mod 2^12 = 2586.
		

Crossrefs

Cf. A341684 (digits of Sum_{k>=0} k!).
Successive approximations for the p-adic integer Sum_{k>=0} k!: A341680 (this sequence), A341681 (p=3), A341682 (p=5), A341683 (p=7).
Cf. A007843 (least positive integer k for which 2^n divides k!).

Programs

  • PARI
    a(n) = my(p=2); if(n==0, 0, lift(sum(k=0, (p-1)*(n+logint((p-1)*n, p)), Mod(k!, p^n))))

Formula

For n > 0, a(n) = (Sum_{k=0..m} k!) mod 2^n, where m = n + floor(log_2(n)).

A020646 Least positive integer k for which 7^n divides k!.

Original entry on oeis.org

1, 7, 14, 21, 28, 35, 42, 49, 49, 56, 63, 70, 77, 84, 91, 98, 98, 105, 112, 119, 126, 133, 140, 147, 147, 154, 161, 168, 175, 182, 189, 196, 196, 203, 210, 217, 224, 231, 238, 245, 245, 252, 259, 266, 273, 280, 287, 294, 294, 301, 308, 315, 322, 329, 336, 343, 343, 343, 350
Offset: 0

Views

Author

Keywords

References

  • H. Ibstedt, Smarandache Primitive Numbers, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 216-229.

Crossrefs

Programs

  • Mathematica
    lpi[n_]:=Module[{k = 1, n7 = 7^n}, While[! Divisible[k!, n7], k++]; k]; Array[lpi,60,0] (* Harvey P. Dale, Jun 29 2017 *)
  • PARI
    a(n) = {k = 1; while (valuation(k!, 7) < n, k++); k;} \\ Michel Marcus, Aug 19 2013

A083312 Largest integer m such that 1+2+...+m divides n.

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 1, 1, 2, 4, 1, 3, 1, 1, 5, 1, 1, 3, 1, 4, 6, 1, 1, 3, 1, 1, 2, 7, 1, 5, 1, 1, 2, 1, 1, 8, 1, 1, 2, 4, 1, 6, 1, 1, 9, 1, 1, 3, 1, 4, 2, 1, 1, 3, 10, 7, 2, 1, 1, 5, 1, 1, 6, 1, 1, 11, 1, 1, 2, 4, 1, 8, 1, 1, 5, 1, 1, 12, 1, 4, 2, 1, 1, 7, 1, 1, 2, 1, 1, 9, 13, 1, 2, 1, 1, 3, 1, 1, 2, 4, 1, 3, 1
Offset: 1

Views

Author

K. Reddy (kakie(AT)indiainfo.com), Jun 03 2003

Keywords

Comments

A dual to A011772.

Examples

			ps(3) = 2 because 1+2 divides 3 and 2 is the largest such number.
ps(5) = 1 because 1 divides 5, while 1+2, 1+2+3 do not divide 5.
		

Crossrefs

Programs

  • PARI
    a(n) = {m = 1; while ((t = m*(m+1)/2) <= n, if (n % t == 0, goodm = m); m ++;); goodm;} \\ Michel Marcus, Aug 12 2013

Extensions

More terms from Sam Alexander, Jan 03 2004

A048841 Least positive integer k for which 11^n divides k!.

Original entry on oeis.org

1, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 121, 132, 143, 154, 165, 176, 187, 198, 209, 220, 231, 242, 242, 253, 264, 275, 286, 297, 308, 319, 330, 341, 352, 363, 363, 374, 385, 396, 407, 418, 429, 440, 451, 462, 473, 484, 484, 495, 506
Offset: 0

Views

Author

Charles T. Le (charlestle(AT)yahoo.com)

Keywords

Crossrefs

See A007843 for more information.

Programs

  • Mathematica
    k[n_]:=Module[{c=11^n,k=11},While[!Divisible[k!,c],k=k+11];k]; Join[{1},Array[k,60]] (* Harvey P. Dale, May 30 2012 *)

A048846 Least positive integer k for which 29^n divides k!.

Original entry on oeis.org

1, 29, 58, 87, 116, 145, 174, 203, 232, 261, 290, 319, 348, 377, 406, 435, 464, 493, 522, 551, 580, 609, 638, 667, 696, 725, 754, 783, 812, 841, 841, 870, 899, 928, 957, 986, 1015, 1044, 1073, 1102, 1131, 1160, 1189, 1218, 1247, 1276
Offset: 0

Views

Author

Charles T. Le (charlestle(AT)yahoo.com)

Keywords

Crossrefs

See A007843 for more information.

Programs

  • Mathematica
    f[n_]:=Module[{k=1},While[!Divisible[k!,29^n],k++];k]; Array[f,50,0] (* Harvey P. Dale, Sep 04 2011 *)
Showing 1-10 of 16 results. Next