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

A045690 Number of binary words of length n (beginning with 0) whose autocorrelation function is the indicator of a singleton.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 37, 74, 142, 284, 558, 1116, 2212, 4424, 8811, 17622, 35170, 70340, 140538, 281076, 561868, 1123736, 2246914, 4493828, 8986540, 17973080, 35943948, 71887896, 143771368, 287542736, 575076661, 1150153322, 2300289022, 4600578044, 9201120918
Offset: 1

Views

Author

Torsten.Sillke(AT)uni-bielefeld.de

Keywords

Comments

The number of binary strings sharing the same autocorrelations.
Appears to be row sums of A155092, beginning from a(2). - Mats Granvik, Jan 20 2009
The number of binary words of length n (beginning with 0) which do not start with an even palindrome (i.e. which are not of the form ss*t where s is a (nonempty) word, s* is its reverse, and t is any (possibly empty) word). - Mamuka Jibladze, Sep 30 2014
From Gus Wiseman, Mar 08 2021: (Start)
This sequence counts each of the following essentially equivalent things:
1. Sets of distinct positive integers with maximum n in which all adjacent elements have quotients > 1/2. For example, the a(1) = 1 through a(6) = 10 sets are:
{1} {2} {3} {4} {5} {6}
{2,3} {3,4} {3,5} {4,6}
{2,3,4} {4,5} {5,6}
{2,3,5} {3,4,6}
{3,4,5} {3,5,6}
{2,3,4,5} {4,5,6}
{2,3,4,6}
{2,3,5,6}
{3,4,5,6}
{2,3,4,5,6}
2. For n > 1, sets of distinct positive integers with maximum n - 1 whose first-differences are term-wise less than their decapitation (remove the maximum). For example, the set q = {2,4,5} has first-differences (2,1), which are not less than (2,4), so q is not counted under a(5). On the other hand, r = {2,3,5,6} has first-differences {1,2,1}, which are less than {2,3,5}, so r is counted under a(6).
3. Compositions of n where each part after the first is less than the sum of all preceding parts. For example, the a(1) = 1 through a(6) = 10 compositions are:
(1) (2) (3) (4) (5) (6)
(21) (31) (41) (51)
(211) (32) (42)
(311) (411)
(212) (321)
(2111) (312)
(3111)
(2121)
(2112)
(21111)
(End)

Crossrefs

Cf. A002083, A005434. A003000 = 2*a(n) for n > 0.
Different from, but easily confused with, A007148 and A093371.
The version with quotients <= 1/2 is A018819.
The version with quotients < 1/2 is A040039.
Multiplicative versions are A337135, A342083, A342084, A342085.
A000045 counts sets containing n with all differences > 2.
A000929 counts partitions with no adjacent parts having quotient < 2.
A342094 counts partitions with no adjacent parts having quotient > 2.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1/2,
           2*a(n-1)-`if`(n::odd, 0, a(n/2)))
        end:
    seq(a(n), n=1..40);  # Alois P. Heinz, Jun 24 2021
  • Mathematica
    a[1] = 1; a[n_] := a[n] = If[EvenQ[n], 2*a[n-1] - a[n/2], 2*a[n-1]]; Array[a, 40] (* Jean-François Alcover, Jul 17 2015 *)
    Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&Min@@Divide@@@Partition[#,2,1]>1/2&]],{n,8}] (* Gus Wiseman, Mar 08 2021 *)
  • PARI
    a(n)=if(n<2,n>0,2*a(n-1)-(1-n%2)*a(n\2))

Formula

a(2n) = 2*a(2n-1) - a(n) for n >= 1; a(2n+1) = 2*a(2n) for n >= 1.
a(n) = A342085(2^n). - Gus Wiseman, Mar 08 2021

Extensions

More terms from James Sellers.
Additional comments from Michael Somos, Jun 09 2000

A093371 Start with any initial string of n numbers s(1), ..., s(n), with s(1) = 2, other s(i)'s = 2 or 3 (so there are 2^(n-1) starting strings). The rule for extending the string is this as follows: To get s(n+1), write the string s(1)s(2)...s(n) as xy^k for words x and y (where y has positive length) and k is maximized, i.e., k = the maximal number of repeating blocks at the end of the sequence. Then a(n) = number of starting strings for which k = 1.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 37, 74, 143, 286, 562, 1124, 2230, 4460, 8884, 17768, 35465, 70930, 141720, 283440, 566600, 1133200, 2265843, 4531686, 9062261, 18124522, 36246826, 72493652, 144982872
Offset: 1

Views

Author

N. J. A. Sloane, Apr 28 2004

Keywords

Comments

See A122536 for many more terms. - N. J. A. Sloane, Oct 25 2012

Crossrefs

Equals A122536/2. - N. J. A. Sloane, Sep 25 2012
Different from, but easily confused with, A007148 and A045690.

Formula

a(n) = 2^(n-1) - A093370(n).

Extensions

More terms from N. J. A. Sloane, Sep 26 2012

A133547 a(n) = sum of squares of first n odd primes.

Original entry on oeis.org

9, 34, 83, 204, 373, 662, 1023, 1552, 2393, 3354, 4723, 6404, 8253, 10462, 13271, 16752, 20473, 24962, 30003, 35332, 41573, 48462, 56383, 65792, 75993, 86602, 98051, 109932, 122701, 138830, 155991, 174760, 194081, 216282, 239083, 263732
Offset: 1

Views

Author

Artur Jasinski, Sep 16 2007

Keywords

Examples

			a(3)=83 because 3^2+5^2+7^2=83.
		

Crossrefs

Programs

  • Mathematica
    c = 2; a = {}; b = 0; Do[b = b + Prime[n]^c; AppendTo[a, b], {n, 2, 1000}]; a

Formula

a(n) = A024450(n+1)-4. - Jason Yuen, Sep 23 2024

A133548 a(n) = sum of cubes of first n odd primes.

Original entry on oeis.org

27, 152, 495, 1826, 4023, 8936, 15795, 27962, 52351, 82142, 132795, 201716, 281223, 385046, 533923, 739302, 966283, 1267046, 1624957, 2013974, 2507013, 3078800, 3783769, 4696442, 5726743, 6819470, 8044513, 9339542, 10782439, 12830822, 15078913, 17650266
Offset: 1

Views

Author

Artur Jasinski, Sep 16 2007, corrected Jun 08 2008

Keywords

Examples

			a(3)=495 because 3^3+5^3+7^3=495.
		

Crossrefs

Programs

  • Mathematica
    c = 3; a = {}; b = 0; Do[b = b + Prime[n]^c; AppendTo[a, b], {n, 2, 1000}]; a
    Accumulate[Prime[Range[2,40]]^3] (* Harvey P. Dale, Oct 31 2024 *)
  • PARI
    a(n) = sum(i=2, n+1, prime(i)^3); \\ Michel Marcus, Nov 05 2013

Formula

a(n) = A098999(n+1) - 8.

Extensions

More terms from Michel Marcus, Nov 05 2013

A133550 Sum of fifth powers of n odd primes.

Original entry on oeis.org

243, 3368, 20175, 181226, 552519, 1972376, 4448475, 10884818, 31395967, 60025118, 129369075, 245225276, 392233719, 621578726, 1039774219, 1754698518, 2599294819, 3949419926, 5753649277, 7826720870, 10903777269, 14842817912
Offset: 1

Views

Author

Artur Jasinski, Sep 16 2007

Keywords

Examples

			a(2)=3368 because 3^5+5^5 = 3368.
		

Crossrefs

Programs

  • Mathematica
    c = 5; a = {}; b = 0; Do[b = b + Prime[n]^c; AppendTo[a, b], {n, 2, 1000}]; a

Formula

a(n) = A122103(n+1)-32.

A286110 Number of distinct hexaflexagons of length n.

Original entry on oeis.org

1, 1, 1, 3, 3, 7, 8, 17, 21, 47, 63, 132, 205, 411, 685, 1353, 2385, 4643, 8496, 16430, 30735, 59343, 112531, 217245, 415628, 803209, 1545463, 2991191, 5778267, 11201883, 21702708, 42141575, 81830748, 159140895, 309590883, 602938098, 1174779397, 2290920127
Offset: 3

Views

Author

Michel Marcus, May 02 2017

Keywords

Crossrefs

Programs

  • Maple
    A286110 := proc(n)
        if type(n,'odd') then
            add(A052307(n,ceil(n/2)+1+3*i),i=0..n/6+1) ;
        else
            add(A052307(n,ceil(n/2)+3*i),i=0..n/6) ;
            %-A052307(n,n/2)/2+A007148(n/2)/2-1
        end if;
    end proc:
    seq(A286110(n),n=3..40) ; # R. J. Mathar, Jul 23 2017
  • Mathematica
    A007148[n_] := (1/2)*(2^(n - 1) + Total[EulerPhi[2*#]*2^(n/#) & /@ Divisors[n]]/(2*n));
    A052307[n_, k_] := Module[{hk = Mod[k, 2], a = 0}, If[k == 0, Return[1]]; Do[a = a + EulerPhi[d]*Binomial[n/d - 1, k/d - 1], {d, Divisors[GCD[k, n]]}]; (a/k + Binomial[Floor[(n - hk)/2], Floor[k/2]])/2];
    a[n_] := Module[{s}, If[Mod[n, 2] == 1, Sum[A052307[n, Ceiling[n/2] + 1 + 3*i], {i, 0, Floor[n/6] + 1}], s = Sum[A052307[n, Ceiling[n/2] + 3*i], {i, 0, Floor[n/6] }]; s - A052307[n, n/2]/2 + A007148[n/2]/2 - 1]];
    Table[a[n], {n, 3, 40}] (* Jean-François Alcover, Nov 28 2017, after R. J. Mathar *)
  • Python
    from sympy import binomial as C, totient, divisors, gcd, floor, ceiling
    def a007148(n):
        if n==1: return 1
        return 2**(n - 2) + sum(totient(2*d)*2**(n//d) for d in divisors(n))//(4*n)
    def a052307(n, k): return 1 if n==0 else C((n//2) - k%2 * (1 - n%2), (k//2))/2 + sum(totient(d)*C(n//d, k//d) for d in divisors(gcd(n, k)))/(2*n)
    def a(n):
        if n%2: return sum([a052307(n, ceiling(n/2) + 1 + 3*i) for i in range(n//6 + 2)])
        else:
            s=sum([a052307(n, ceiling(n/2) + 3*i) for i in range(n//6 + 1)])
            return s - a052307(n, n//2)//2 + a007148(n//2)//2 - 1
    print([a(n) for n in range(3, 41)]) # Indranil Ghosh, Jul 24 2017, after Maple code

A133549 Sum of the fourth powers of the first n odd primes.

Original entry on oeis.org

81, 706, 3107, 17748, 46309, 129830, 260151, 539992, 1247273, 2170794, 4044955, 6870716, 10289517, 15169198, 23059679, 35177040, 49022881, 69174002, 94585683, 122983924, 161934005, 209392326, 272134567, 360663848, 464724249, 577275130
Offset: 1

Views

Author

Artur Jasinski, Sep 16 2007

Keywords

Examples

			a(2)=706 because 3^4 + 5^4 = 706.
		

Crossrefs

Programs

  • Maple
    a:=proc (n) options operator, arrow: add(ithprime(j)^4, j=2..n+1) end proc: seq(a(n),n=1..26); # Emeric Deutsch, Oct 02 2007
  • Mathematica
    c = 4; a = {}; b = 0; Do[b = b + Prime[n]^c; AppendTo[a, b], {n, 2, 1000}]; a

Formula

a(n) = A122102(n+1) - 16. - Michel Marcus, Nov 05 2013

Extensions

Comment corrected by Michel Marcus, Nov 05 2013
Showing 1-7 of 7 results.