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.

Previous Showing 11-20 of 22 results. Next

A173527 a(n) = 1 + A053828(n-1), where A053828 is the sum of digits in base 7.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Feb 20 2010

Keywords

Comments

If A053828 is regarded as a triangle then the rows converge to this sequence, i.e., a(n) = A053828(7^k+n-1) in the limit k->infinity, where k plays the role of a row index in A053828.
See conjecture in the entry A000120.
This is the case for base b=7 for the sum of digits. A063787 and A173523 to A173526 deal with the bases 2 to 6. A173525 contains generic remarks concerning these 8 sequences which look in equivalent ways at their sum of digits as a sequence with triangular structure.

Crossrefs

Programs

  • Maple
    A053828 := proc(n) add(d, d=convert(n,base,7)) ; end proc:
    A173527 := proc(n) local b; b := 7 ; if n < b then n; else k := n/(b-1); k := ceil(log(k)/log(b)) ; A053828(b^k+n-1) ; end if; end proc:
    seq(A173527(n),n=1..100) ; # R. J. Mathar, Dec 09 2010
  • Mathematica
    Table[Total[IntegerDigits[n-1,7]]+1,{n,110}] (* Harvey P. Dale, Apr 01 2018 *)

Formula

a(n) = A053828(7^k+n-1) where k >= ceiling(log_7(n/6)). [R. J. Mathar, Dec 09 2010]
Conjecture: Fixed point of the morphism 1->{1,2,3,...b}, 2->{2,3,4...,b+1}, j->{j,j+1,...,j+b-1} for b=7. [Joerg Arndt, Dec 08 2010]

Extensions

More terms from Vincenzo Librandi, Feb 21 2010

A047457 Numbers that are congruent to {3, 4} mod 8.

Original entry on oeis.org

3, 4, 11, 12, 19, 20, 27, 28, 35, 36, 43, 44, 51, 52, 59, 60, 67, 68, 75, 76, 83, 84, 91, 92, 99, 100, 107, 108, 115, 116, 123, 124, 131, 132, 139, 140, 147, 148, 155, 156, 163, 164, 171, 172, 179, 180, 187, 188, 195, 196, 203, 204, 211, 212, 219, 220, 227
Offset: 1

Views

Author

Keywords

Comments

Union of A017101 and A017113. - Michel Marcus, Feb 25 2014
Numbers whose binary reflected Gray code (A014550) has a single trailing zero. - Amiram Eldar, May 17 2021

Crossrefs

Programs

Formula

a(n) = 8*n - a(n-1) - 9 (with a(1) = 3). - Vincenzo Librandi, Aug 06 2010
G.f.: x*(3+x+4*x^2)/((1-x)^2*(1+x)). - Colin Barker, May 13 2012
a(n) = (-5 - 3*(-1)^n + 8*n)/2. - Colin Barker, May 14 2012
A000120(a(n)-1) = A000120(a(n)+1) = A063787(n). - Ilya Lopatin and Juri-Stepan Gerasimov, Feb 25 2014
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)-1)*Pi/16 + log(2)/4 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 18 2021

A088748 a(n) = 1 + Sum_{k=0..n-1} 2 * A014577(k) - 1.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Oct 14 2003

Keywords

Comments

Let s(0)=1; s(n+1)=s(n),ri(n), where ri(n) is s(n) reversed and incremented. Each s(n) is an initial part of this sequence.
For each m, a(1 to 2^m) is a permutation of A063787(1 to 2^m). For k=1 to 2^m, a(2^m+1-A088372(m,k)) = A063787(k).
Partial sums give A164910: (1, 3, 6, 8, 11, 15, 20, ...).
a(0) = 1, then using the dragon curve sequence A014577: (1, 1, 0, 1, 1, ...) as a code: (1 = add to current term, 0 = subtract from current term, to get the next term), see example.
Rows of A088696 tend to this sequence.

Examples

			The first 8 terms of the sequence = (1, 2, 3, 2, 3, 4, 3, 2), where the first four terms = (1, 2, 3, 2). Reverse, add 1, getting (3, 4, 3, 2), then append.
The sequence begins with "1", then using the dragon curve coding, we get:
1...2...3...2...3...4... = A088748
....1...1...0...1...1... = A014577, the dragon curve.
		

Crossrefs

Programs

  • Mathematica
    Array[1 + Sum[2 (1 - (((Mod[#1, 2^(#2 + 2)]/2^#2)) - 1)/2) - 1 &[k, IntegerExponent[k, 2]], {k, # - 1}] &, 102] (* Michael De Vlieger, Aug 26 2020 *)

Formula

a(n) = 1 + A005811(n). [Joerg Arndt, Dec 11 2012]

Extensions

Edited by Don Reble, Nov 15 2005
Additional comments from Gary W. Adamson, Aug 30 2009
Edited by N. J. A. Sloane, Sep 06 2009

A082691 a(1)=1, a(2)=2, then if the first 3*2^k-1 terms are a(1), a(2), ..., a(3*2^k - 1), the first 3*2^(k+1)-1 terms are a(1), a(2), ..., a(3*2^k - 1), a(1), a(2), ..., a(3*2^k - 1), a(3*2^k-1) + 1.

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 5, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 5, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 5, 6, 7, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3
Offset: 1

Views

Author

Benoit Cloitre, Apr 12 2003

Keywords

Comments

Consider the subsequence b(k) such that a(b(k))=1. Then 3k - b(k) = A063787(k+1) and b(k) = 1 + A004134(k-1).
From Sam Alexander, Nov 27 2010: (Start)
A naive way to try and guess whether a sequence is periodic, based on its first k terms (n1, ..., nk), is to look at all sequences which have period less than k, and guess "periodic" if any of them extend (n1, ..., nk), "nonperiodic" otherwise.
a(1)=1, a(2)=2. Suppose a(1), ..., a(n) have been defined, n > 1.
1. If the above guessing method guesses that (a(1), ..., a(n)) is an initial segment of a periodic sequence, then let a(n+1) be the least nonzero number not appearing in (a(1), ..., a(n)).
2. Otherwise, let (a(n+1), ..., a(2n)) be a copy of (a(1), ..., a(n)).
This sequence thwarts the guessing attempt, tricking the guesser into changing his mind infinitely many times as n->infinity. (End)
As n increases, the average value of the first n terms approaches 7/3 = 2.333... - Maxim Skorohodov, Dec 15 2022

Examples

			To construct the sequence: start with (1, 2); concatenating those 2 terms gives (1,2,1,2). Appending 3 gives the first 5 terms: (1,2,1,2,3). Concatenating those 5 terms gives (1,2,1,2,3,1,2,1,2,3). Appending 4 gives the first 11 terms: (1,2,1,2,3,1,2,1,2,3,4), etc.
		

Crossrefs

Cf. A082692 (partial sums), A182659, A182660 (other sequences engineered to spite naive guessers).

A131136 Denominator of (exponential) expansion of log((x/2-1)/(x-1)).

Original entry on oeis.org

1, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32, 8, 16, 16, 32, 16, 32, 32, 64, 4, 8, 8, 16, 8, 16, 16, 32, 8, 16, 16, 32, 16, 32, 32, 64, 8, 16, 16, 32, 16, 32, 32, 64, 16, 32, 32, 64, 32, 64, 64, 128, 4, 8, 8, 16, 8, 16, 16, 32, 8, 16, 16
Offset: 0

Views

Author

Paul Barry, Jun 17 2007

Keywords

Comments

a(n+1) = 2^A063787(n). a(n+1) = A001316(n)/2. - Stephen Crowley, Aug 25 2008
Also, 1 followed by A117973. - Omar E. Pol, Dec 11 2010

Examples

			From _Omar E. Pol_, Jun 14 2009, Dec 11 2010: (Start)
May be written as a triangle by using the Crowley formula with A063787:
.1;
.2;
.4,4;
.8,4,8,8;
.16,4,8,8,16,8,16,16;
.32,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32;
.64,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,8,16,16,32,16,32,32,64,16,...
Also
1,
2,
4,
4,8,
4,8,8,16,
4,8,8,16,8,16,16,32,
4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,
4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,8,16,16,32,16,32,32,64,16,32,...
(End)
		

Crossrefs

Cf. A063787.
Cf. A000079, A117973. - Omar E. Pol, Jun 14 2009, Dec 11 2010

Programs

  • Maple
    a(n)=abs(op(1, numer(expand(Zeta(2n)/Zeta(1-2n))))) # Stephen Crowley, Aug 25 2008
  • Mathematica
    With[{nn=80},Denominator[CoefficientList[Series[Log[(x/2-1)/(x-1)],{x,0,nn}],x] Range[0,nn]!]] (* Harvey P. Dale, Apr 28 2016 *)

Formula

a(n) = 0^n + n + Sum_{k=0..n-1} (-1)^(1 + binomial(n-1,k)). - Stephen Crowley, Aug 25 2008

A354581 Numbers k such that the k-th composition in standard order is rucksack, meaning every distinct partial run has a different sum.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 56, 57, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 77, 80, 81, 82, 84, 85, 86, 88
Offset: 0

Views

Author

Gus Wiseman, Jun 15 2022

Keywords

Comments

We define a partial run of a sequence to be any contiguous constant subsequence.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The term rucksack is short for run-knapsack.

Examples

			The terms together with their corresponding compositions begin:
   0: ()
   1: (1)
   2: (2)
   3: (1,1)
   4: (3)
   5: (2,1)
   6: (1,2)
   7: (1,1,1)
   8: (4)
   9: (3,1)
  10: (2,2)
  12: (1,3)
  13: (1,2,1)
  15: (1,1,1,1)
Missing are:
  11: (2,1,1)
  14: (1,1,2)
  23: (2,1,1,1)
  27: (1,2,1,1)
  29: (1,1,2,1)
  30: (1,1,1,2)
  39: (3,1,1,1)
  43: (2,2,1,1)
  46: (2,1,1,2)
		

Crossrefs

The version for binary indices is A000225.
Counting distinct sums of full runs gives A353849, partitions A353835.
For partitions we have A353866, counted by A353864, complement A354583.
These compositions are counted by A354580.
Counting distinct sums of partial runs gives A354907, partitions A353861.
A066099 lists all compositions in standard order.
A124767 counts runs in standard compositions.
A124771 counts distinct contiguous subsequences, non-contiguous A334299.
A238279 and A333755 count compositions by number of runs.
A351014 counts distinct runs in standard compositions, firsts A351015.
A353838 ranks partitions with all distinct run-sums, counted by A353837.
A353851 counts compositions with all equal run-sums, ranked by A353848.
A353852 ranks compositions with all distinct run-sums, counted by A353850.
A353853-A353859 pertain to composition run-sum trajectory.
A353932 lists run-sums of standard compositions, rows ranked by A353847.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@Total/@Union@@Subsets/@Split[stc[#]]&]

A162349 First differences of A160412.

Original entry on oeis.org

3, 9, 9, 27, 9, 27, 27, 81, 9, 27, 27, 81, 27, 81, 81, 243, 9, 27, 27, 81, 27, 81, 81, 243, 27, 81, 81, 243, 81, 243, 243, 729, 9, 27, 27, 81, 27, 81, 81, 243, 27, 81, 81, 243, 81, 243, 243, 729, 27, 81, 81, 243, 81, 243, 243, 729, 81, 243, 243, 729, 243, 729
Offset: 1

Views

Author

Omar E. Pol, Jul 14 2009

Keywords

Comments

Note that if A048883 is written as a triangle then rows converge to this sequence. - Omar E. Pol, Nov 15 2009

Crossrefs

Programs

  • Mathematica
    a[n_] := 3^(1 + DigitCount[n - 1, 2, 1]); Array[a, 100] (* Amiram Eldar, Feb 02 2024 *)

Formula

a(n) = 3^A063787(n) = 3 * A048883(n-1). - Amiram Eldar, Feb 02 2024

Extensions

More terms from Omar E. Pol, Nov 15 2009
More terms from Colin Barker, Apr 19 2015
More terms from Amiram Eldar, Feb 02 2024

A354582 Number of distinct contiguous constant subsequences (or partial runs) in the k-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 2, 3, 4, 1, 2, 2, 3, 2, 3, 2, 4, 2, 2, 3, 3, 3, 3, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 2, 3, 5, 2, 2, 3, 3, 3, 3, 2, 4, 3, 3, 4, 3, 4, 4, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 2, 3, 4, 5, 2, 3, 2, 4, 3, 4, 3
Offset: 0

Views

Author

Gus Wiseman, Jun 13 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			Composition number 981 in standard order is (1,1,1,2,2,2,1), with partial runs (1), (2), (1,1), (2,2), (1,1,1), (2,2,2), so a(981) = 6.
As a triangle:
  1
  1 2
  1 2 2 3
  1 2 2 3 2 2 3 4
  1 2 2 3 2 3 2 4 2 2 3 3 3 3 4 5
  1 2 2 3 2 3 3 4 2 3 3 4 3 2 3 5 2 2 3 3 3 3 2 4 3 3 4 3 4 4 5 6
		

Crossrefs

The version for partitions is A001222, full A001221.
If we allow any constant subsequence we get A063787.
If we allow any contiguous subsequence we get A124771.
Positions of first appearances are A126646.
The version for binary indices is A330036, full A005811.
If we allow any subsequence we get A334299.
The full version is A351014, firsts A351015.
The version for run-sums of partitions is A353861, full A353835.
Counting distinct sums of partial runs gives A354907, full A353849.
A066099 lists all compositions in standard order.
A124767 counts runs in standard compositions.
A238279 and A333755 count compositions by number of runs.
A353852 ranks compositions with all distinct run-sums, counted by A353850.
A353853-A353859 pertain to composition run-sum trajectory.
A353932 lists run-sums of standard compositions, rows ranked by A353847.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    pre[y_]:=NestWhileList[Most,y,Length[#]>1&];
    Table[Length[Union[Join@@pre/@Split[stc[n]]]],{n,0,100}]

A255683 Sum of the binary numbers whose digits are cyclic permutations of the binary expansion of n.

Original entry on oeis.org

1, 3, 6, 7, 14, 14, 21, 15, 30, 30, 45, 30, 45, 45, 60, 31, 62, 62, 93, 62, 93, 93, 124, 62, 93, 93, 124, 93, 124, 124, 155, 63, 126, 126, 189, 126, 189, 189, 252, 126, 189, 189, 252, 189, 252, 252, 315, 126, 189, 189, 252, 189, 252, 252, 315, 189, 252, 252, 315
Offset: 1

Views

Author

Paolo P. Lava, Mar 02 2015

Keywords

Comments

All the primes in the sequence are Mersenne primes (A000668).

Examples

			6 in base 2 is 110 and all the cyclic permutations of its digits are: 110, 101, 011. In base 10 they are 6, 5, 3 and their sum is 6 + 5 + 3 = 14.
From _Peter Bala_, Mar 02 2015: (Start)
Let b(n) = A063787(n), beginning [1, 2, 2, 3, 2, 3, 3, 4, ...]. Then
[a(1)] = 1*[b(1)]; [a(2), a(3)] = 3*[b(1), b(2)];
[a(4), a(5), a(6), a(7)] = 7*[b(1), b(2), b(3), b(4)];
[a(8), a(9), a(10), a(11), a(12), a(13), a(14), a(15)] = 15*[b(1), b(2), b(3), b(4), b(5), b(6), b(7), b(8)].
It is conjectured that this relationship continues. (End)
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,k,n;
    for n from 1 to q do a:=convert(n,binary,decimal); b:=n; c:=ilog10(a);
    for k from 1 to c do a:=(a mod 10)*10^c+trunc(a/10); b:=b+convert(a,decimal,binary); od;
    print(b); od; end: P(1000);
  • Mathematica
    f[n_] := Block[{b = 2, w = IntegerDigits[n, b]}, Apply[Plus, FromDigits[#, b] & /@ (RotateRight[w, #] & /@ Range[Length@ w])]]; Array[f, 60] (* Michael De Vlieger, Mar 04 2015 *)
    Table[Total[FromDigits[#,2]&/@Table[RotateRight[IntegerDigits[k,2],n],{n,IntegerLength[k,2]}]],{k,60}] (* Harvey P. Dale, Jan 03 2018 *)

Formula

a(2^n) = Sum_{k=1..n} 2^k = 2^(n+1)-1.
a(5+4*k) = a(6+4*k), for k >= 0.
For n >= 0 and 0 <= i <= 2^n - 1 we conjecture a(2^n + i) = (2^(n+1) - 1)*A063787(i+1). An example is given below. - Peter Bala, Mar 02 2015
a(n) = A000120(n)*(A000918(A000523(n) + 1) + 1). - Alan Michael Gómez Calderón, Jul 07 2025

A330038 a(1) = 1, a(n) = [n/2] + a([n/2]) + a([(n+1)/2]) for n > 1, where [x] = floor(x).

Original entry on oeis.org

1, 3, 5, 8, 10, 13, 16, 20, 22, 25, 28, 32, 35, 39, 43, 48, 50, 53, 56, 60, 63, 67, 71, 76, 79, 83, 87, 92, 96, 101, 106, 112, 114, 117, 120, 124, 127, 131, 135, 140, 143, 147, 151, 156, 160, 165, 170, 176, 179, 183, 187, 192, 196, 201, 206, 212, 216, 221, 226, 232
Offset: 1

Views

Author

Stefano Spezia, Nov 28 2019

Keywords

Comments

a(n) is a sharp lower bound of the greatest whole number k such that there is a hypergraph (V, H) with |V| = k having no isolated vertices and containing no partitions of size greater than n (see Brian & Larson link, i.e. Definition 3.1, Lemma 4.2 and Proof of Theorem 4.6).
Partial sums of A063787. - Robert Israel, Nov 28 2019

Crossrefs

Cf. A004526, A063787 (first differences), A000788, A272011.

Programs

  • Magma
    I:=[1]; [n le 1 select I[n] else Floor(n/2)+Self(Floor(n/2))+Self(Floor((n+1)/2)): n in [1..60]];
    
  • Maple
    f:= proc(n) option remember;
    floor(n/2) + procname(floor(n/2)) + procname(floor((n+1)/2))
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Nov 28 2019
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Floor[n/2] + a[Floor[n/2]] + a[Floor[(n + 1)/2]];  Array[a, 60] (* Amiram Eldar, Nov 28 2019 *)
  • PARI
    a(n) = my(v=binary(n),t=#v); for(i=1,#v, if(v[i],v[i]=t++,t--);); fromdigits(v,2)>>1; \\ Kevin Ryde, Dec 16 2021
    
  • Python
    # Kevin Ryde's first formula
    def a(n): return sum(bin(i).count("1") for i in range(n)) + n
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Dec 16 2021
    
  • Python
    # Kevin Ryde's second formula
    def a(n):
        b = list(map(int, bin(n)[2:]))
        e = [i for i, bi in enumerate(b[::-1]) if bi][::-1]
        return sum((ei + 2*i)*2**ei for i, ei in enumerate(e, 1))//2
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Dec 16 2021

Formula

G.f. g(z) satisfies g(z) = z^2/((1+z)(1-z)^2) + (1+z)^2 g(z^2)/z. - Robert Israel, Nov 28 2019
From Kevin Ryde, Dec 16 2021: (Start)
a(n) = A000788(n-1) + n.
a(n) = (1/2) * Sum_{i=1..k} (e[i]+2*i) * 2^e[i], where binary expansion n = 2^e[1] + ... + 2^e[k] with descending exponents e[1] > e[2] > ... > e[k] (A272011).
(End)
Previous Showing 11-20 of 22 results. Next