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.

User: I. J. Kennedy

I. J. Kennedy's wiki page.

I. J. Kennedy has authored 3 sequences.

A125268 Numbers that end with decimal digit 1, 3, 7, or 9 and that produce only composite numbers when any of the digits 0,1,...,9 is inserted anywhere in them (including at the beginning or end).

Original entry on oeis.org

25011, 52647, 72753, 122313, 168699, 283251, 324021, 598041, 783441, 804131, 837207, 924807, 1247241, 1905759, 2514819, 3461101, 3514077, 3617389, 3905817, 4112913, 4142139, 4203151, 4229871, 4283679, 4531907, 4628827, 4828443, 5380413, 5478091, 5632671, 5714889, 5818569, 5989269, 5990961
Offset: 1

Author

I. J. Kennedy, Jan 15 2007

Keywords

Comments

Since digit 0 can be inserted at the beginning of a term, each term must be composite.

Crossrefs

Programs

  • Maple
    filter:= proc(n) local x,y,d,t;
      x:= n; y:= 0;
      for d from 0 to ilog10(n)+1 do
         for t from 0 to 9 do
           if isprime(10^(d+1)*x+10^d*t + y) then return false fi;
         od;
         t:= x mod 10;
         y:= y + 10^d*t;
         x:= (x-t)/10;
      od;
      true
    end proc:
    select(filter, [seq(seq(10*i+j,j=[1,3,7,9]),i=0..10^6)]); # Robert Israel, Sep 12 2016
  • PARI
    { printA125268(U=8) = my(v,t); v=vector(10^U); forprime(p=11,10^(U+1), if(p<=U,v[p]=p); for(i=1,#Str(p), t=(p\10^i) * 10^(i-1) + (p%10^(i-1)); if(#Str(t)==#Str(p)-1,v[t]=p););); forstep(n=1,10^U,2, if(n%10==5||v[n],next); print1(n,", ");); } \\ prints terms below 10^U, by Max Alekseyev, Sep 12 2016

Extensions

Corrected and extended by Robert G. Wilson v, Jan 26 2007
Removed incorrect terms and extended by Max Alekseyev, Sep 12 2016

A015818 Number of solutions of +- 1 +- 2 +- ... +- (n-1) +- n = 0 in which the partial sums +- 1 +- ... +- k (1<=k<=n) are all distinct.

Original entry on oeis.org

1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 10, 14, 0, 0, 36, 40, 0, 0, 134, 258, 0, 0, 702, 1040, 0, 0, 4170, 5996, 0, 0, 23642, 36616, 0, 0, 140500, 217002, 0, 0, 852132, 1374692, 0, 0, 5411800, 8852230, 0, 0, 35764246, 56370054, 0, 0, 232969442, 376479130, 0, 0, 1555855594, 2534308444
Offset: 0

Author

Keywords

Comments

If n==1 or 2 (mod 4) then a(n)=0.

Examples

			For n=4 there are 2 solutions: +1-2-3+4=0 and -1+2+3-4=0.
		

Crossrefs

a(n) <= A063865(n).

Programs

  • PARI
    issol(i, n) = {b = binary(i); while(length(b) < n, b = concat(0, b)); if (! sum(k=1, n, if (b[k], k, -k)), vsp = []; lastnb = 0; for (j=1, n, vsp = Set(concat(vsp, sum(k=1, j, if (b[k], k, -k)))); if (#vsp == lastnb, return (0)); lastnb = #vsp;); return (1););}
    a(n) = if ((!n) || ((n % 4) != 1) && ((n % 4) != 2), sum(i=0, 2^n-1, issol(i, n)));  \\ Michel Marcus, May 22 2014

Extensions

a(36)-a(46) from Ray Chandler, Nov 29 2008
a(47)-a(58) from Sean A. Irvine, Dec 13 2018

A008466 a(n) = 2^n - Fibonacci(n+2).

Original entry on oeis.org

0, 0, 1, 3, 8, 19, 43, 94, 201, 423, 880, 1815, 3719, 7582, 15397, 31171, 62952, 126891, 255379, 513342, 1030865, 2068495, 4147936, 8313583, 16655823, 33358014, 66791053, 133703499, 267603416, 535524643, 1071563515, 2143959070, 4289264409, 8580707127
Offset: 0

Keywords

Comments

Toss a fair coin n times; a(n) is number of possible outcomes having a run of 2 or more heads.
Also the number of binary words of length n with at least two neighboring 1 digits. For example, a(4)=8 because 8 binary words of length 4 have two or more neighboring 1 digits: 0011, 0110, 0111, 1011, 1100, 1101, 1110, 1111 (cf. A143291). - Alois P. Heinz, Jul 18 2008
Equivalently, number of solutions (x_1, ..., x_n) to the equation x_1*x_2 + x_2*x_3 + x_3*x_4 + ... + x_{n-1}*x_n = 1 in base-2 lunar arithmetic. - N. J. A. Sloane, Apr 23 2011
Row sums of triangle A153281 = (1, 3, 8, 19, 43, ...). - Gary W. Adamson, Dec 23 2008
a(n-1) is the number of compositions of n with at least one part >= 3. - Joerg Arndt, Aug 06 2012
One less than the cardinality of the set of possible numbers of (leaf-) nodes of AVL trees with height n (cf. A143897, A217298). a(3) = 4-1, the set of possible numbers of (leaf-) nodes of AVL trees with height 3 is {5,6,7,8}. - Alois P. Heinz, Mar 20 2013
a(n) is the number of binary words of length n such that some prefix contains three more 1's than 0's or two more 0's than 1's. a(4) = 8 because we have: {0,0,0,0}, {0,0,0,1}, {0,0,1,0}, {0,0,1,1}, {0,1,0,0}, {1,0,0,0}, {1,1,1,0}, {1,1,1,1}. - Geoffrey Critzer, Dec 30 2013
With offset 0: antidiagonal sums of P(j,n) array of j-th partial sums of Fibonacci numbers. - Luciano Ancora, Apr 26 2015

Examples

			From _Gus Wiseman_, Jun 25 2020: (Start)
The a(2) = 1 through a(5) = 19 compositions of n + 1 with at least one part >= 3 are:
  (3)  (4)    (5)      (6)
       (1,3)  (1,4)    (1,5)
       (3,1)  (2,3)    (2,4)
              (3,2)    (3,3)
              (4,1)    (4,2)
              (1,1,3)  (5,1)
              (1,3,1)  (1,1,4)
              (3,1,1)  (1,2,3)
                       (1,3,2)
                       (1,4,1)
                       (2,1,3)
                       (2,3,1)
                       (3,1,2)
                       (3,2,1)
                       (4,1,1)
                       (1,1,1,3)
                       (1,1,3,1)
                       (1,3,1,1)
                       (3,1,1,1)
(End)
		

References

  • W. Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 2nd ed. New York: Wiley, p. 300, 1968.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 14, Exercise 1.

Crossrefs

Cf. A153281, A186244 (ternary words), A335457, A335458, A335516.
The non-contiguous version is A335455.
Row 2 of A340156. Column 3 of A109435.

Programs

  • Magma
    [2^n-Fibonacci(n+2): n in [0..40]]; // Vincenzo Librandi, Apr 27 2015
    
  • Maple
    a:= n-> (<<3|1|0>, <-1|0|1>, <-2|0|0>>^n)[1, 3]:
    seq(a(n), n=0..50); # Alois P. Heinz, Jul 18 2008
    # second Maple program:
    with(combinat): F:=fibonacci; f:=n->add(2^(n-1-i)*F(i),i=0..n-1); [seq(f(n),n=0..50)]; # N. J. A. Sloane, Mar 31 2014
  • Mathematica
    Table[2^n-Fibonacci[n+2],{n,0,20}] (* Vladimir Joseph Stephan Orlovsky, Jul 22 2008 *)
    MMM = 30;
    For[ M=2, M <= MMM, M++,
    vlist = Array[x, M];
    cl[i_] := And[ x[i], x[i+1] ];
    cl2 = False; For [ i=1, i <= M-1, i++, cl2 = Or[cl2, cl[i]] ];
    R[M] = SatisfiabilityCount[ cl2, vlist ] ]
    Table[ R[M], {M,2,MMM}]
    (* Find Boolean values of variables that satisfy the formula x1 x2 + x2 x3 + ... + xn-1 xn = 1; N. J. A. Sloane, Apr 23 2011 *)
    LinearRecurrence[{3,-1,-2},{0,0,1},40] (* Harvey P. Dale, Aug 09 2013 *)
    nn=33; a=1/(1-2x); b=1/(1-2x^2-x^4-x^6/(1-x^2));
    CoefficientList[Series[b(a x^3/(1-x^2)+x^2a),{x,0,nn}],x] (* Geoffrey Critzer, Dec 30 2013 *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n+1],Max@@#>2&]],{n,0,10}] (* Gus Wiseman, Jun 25 2020 *)
  • PARI
    a(n) = 2^n-fibonacci(n+2) \\ Charles R Greathouse IV, Feb 03 2014
    
  • SageMath
    def A008466(n): return 2^n - fibonacci(n+2) # G. C. Greubel, Apr 23 2025

Formula

a(1)=0, a(2)=1, a(3)=3, a(n) = 3*a(n-1) - a(n-2) - 2*a(n-3). - Miklos Kristof, Nov 24 2003
G.f.: x^2/((1-2*x)*(1-x-x^2)). - Paul Barry, Feb 16 2004
From Paul Barry, May 19 2004: (Start)
Convolution of Fibonacci(n) and (2^n - 0^n)/2.
a(n) = Sum_{k=0..n} (2^k-0^k)*Fibonacci(n-k)/2.
a(n+1) = Sum_{k=0..n} Fibonacci(k)*2^(n-k).
a(n) = 2^n*Sum_{k=0..n} Fibonacci(k)/2^k. (End)
a(n) = a(n-1) + a(n-2) + 2^(n-2). - Jon Stadler (jstadler(AT)capital.edu), Aug 21 2006
a(n) = 2*a(n-1) + Fibonacci(n-1). - Thomas M. Green, Aug 21 2007
a(n) = term (1,3) in the 3 X 3 matrix [3,1,0; -1,0,1; -2,0,0]^n. - Alois P. Heinz, Jul 18 2008
a(n) = 2*a(n-1) - a(n-3) + 2^(n-3). - Carmine Suriano, Mar 08 2011