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

A374356 a(n) is the greatest fibbinary number f <= n such that n - f is also a fibbinary number whose binary expansion has no common 1's with that of f (where fibbinary numbers correspond to A003714).

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 4, 5, 8, 9, 10, 10, 8, 9, 10, 10, 16, 17, 18, 18, 20, 21, 20, 21, 16, 17, 18, 18, 20, 21, 20, 21, 32, 33, 34, 34, 36, 37, 36, 37, 40, 41, 42, 42, 40, 41, 42, 42, 32, 33, 34, 34, 36, 37, 36, 37, 40, 41, 42, 42, 40, 41, 42, 42, 64, 65, 66, 66
Offset: 0

Views

Author

Rémy Sigrist, Jul 06 2024

Keywords

Comments

To compute a(n): replace every other bit with zero (starting with the second bit) in each run of consecutive 1's in the binary expansion of n.
From Gus Wiseman, Jul 11 2025: (Start)
This is the greatest binary rank of a sparse subset of the binary indices of n, where:
1. The binary indices of a nonnegative integer are the positions of 1 in its reversed binary expansion.
2. A set is sparse iff 1 is not a first difference.
3. The binary rank of a set {S_1,S_2,...} is Sum_i 2^(S_i-1).
(End)

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2      10         10
   3     2      11         10
   4     4     100        100
   5     5     101        101
   6     4     110        100
   7     5     111        101
   8     8    1000       1000
   9     9    1001       1001
  10    10    1010       1010
  11    10    1011       1010
  12     8    1100       1000
  13     9    1101       1001
  14    10    1110       1010
  15    10    1111       1010
  16    16   10000      10000
		

Crossrefs

The union is A003714 (Fibbinary numbers).
For prime instead of binary indices we have A385216.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A166469 counts sparse submultisets of prime indices, maximal A385215.
A245564 counts sparse subsets of binary indices, maximal case A384883.
A319630 ranks sparse submultisets of prime indices, complement A104210.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    fbi[q_]:=If[q=={},0,Total[2^q]/2];
    Table[Max@@fbi/@Select[Subsets[bpe[n]],FreeQ[Differences[#],1]&],{n,0,100}] (* Gus Wiseman, Jul 11 2025 *)
  • PARI
    a(n) = { my (v = 0, e, x, y, b); while (n, x = y = 0; e = valuation(n, 2); for (k = 0, oo, if (bittest(n, e+k), n -= b = 2^(e+k); [x, y] = [y + b, x], v += x; break;););); return (v); }

Formula

a(n) = A374354(n, A277561(n)-1).
a(n) = n - A374355(n).
a(n) <= n with equality iff n is a fibbinary number.

A245565 a(n) = Product_{i in row n of A245562} Pell(i+1).

Original entry on oeis.org

1, 2, 2, 5, 2, 4, 5, 12, 2, 4, 4, 10, 5, 10, 12, 29, 2, 4, 4, 10, 4, 8, 10, 24, 5, 10, 10, 25, 12, 24, 29, 70, 2, 4, 4, 10, 4, 8, 10, 24, 4, 8, 8, 20, 10, 20, 24, 58, 5, 10, 10, 25, 10, 20, 25, 60, 12, 24, 24, 60, 29, 58, 70, 169, 2, 4, 4, 10, 4, 8, 10, 24, 4, 8, 8, 20, 10, 20, 24, 58, 4, 8, 8, 20, 8, 16
Offset: 0

Views

Author

N. J. A. Sloane, Aug 10 2014; revised Sep 05 2014

Keywords

Comments

This is the Run Length Transform of S(n) = Pell(n+1) (cf. A000129).
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g. 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).

Crossrefs

Programs

  • Maple
    A000129 := proc(n) option remember; if n <=1 then n; else 2*A000129(n-1)+A000129(n-2); fi; end;
    ans:=[];
    for n from 0 to 100 do lis:=[]; t1:=convert(n,base,2); L1:=nops(t1);
    out1:=1; c:=0;
    for i from 1 to L1 do
       if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
       elif out1 = 0 and t1[i] = 1 then c:=c+1;
       elif out1 = 1 and t1[i] = 0 then c:=c;
       elif out1 = 0 and t1[i] = 0 then lis:=[c,op(lis)]; out1:=1; c:=0;
       fi;
       if i = L1 and c>0 then lis:=[c,op(lis)]; fi;
                       od:
    a:=mul(A000129(i+1), i in lis);
    ans:=[op(ans),a];
    od:
    ans;

A384883 Number of maximal sparse subsets of the binary indices of n, where a set is sparse iff 1 is not a first difference.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 02 2025

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

Examples

			The binary indices of 27 are {1,2,4,5}, with maximal sparse subsets {{1,4},{1,5},{2,4},{2,5}}, so a(27) = 4.
		

Crossrefs

For subsets of {1..n} we get A000931 (shifted), maximal case of A000045 (shifted).
This is the maximal case of A245564.
The greatest number whose binary indices are one of these subsets is A374356.
For prime instead of binary indices we have A385215, maximal case of A166469.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A202064 counts subsets containing n with k maximal runs.
A384877 gives lengths of maximal anti-runs in binary indices, firsts A384878.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    spars[S_]:=Select[Subsets[S],FreeQ[Differences[#],1]&];
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    maximize[sys_]:=Complement@@Prepend[Most[Subsets[#]]&/@sys,sys];
    Table[Length[maximize[spars[bpe[n]]]],{n,0,100}]

A246028 a(n) = Product_{i in row n of A245562} Fibonacci(i+1).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Aug 15 2014; revised Sep 05 2014

Keywords

Comments

This is the Run Length Transform of S(n) = Fibonacci(n+1).
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g., 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).

Crossrefs

Programs

  • Maple
    with(combinat); ans:=[];
    for n from 0 to 100 do lis:=[]; t1:=convert(n,base,2); L1:=nops(t1); out1:=1; c:=0;
    for i from 1 to L1 do
    if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
    elif out1 = 0 and t1[i] = 1 then c:=c+1;
    elif out1 = 1 and t1[i] = 0 then c:=c;
    elif out1 = 0 and t1[i] = 0 then lis:=[c,op(lis)]; out1:=1; c:=0;
    fi;
    if i = L1 and c>0 then lis:=[c,op(lis)]; fi;
    od:
    a:=mul(fibonacci(i+1), i in lis);
    ans:=[op(ans),a];
    od:
    ans;
  • Mathematica
    a[n_] := Sum[Mod[Binomial[n-k, 2k] Binomial[n, k], 2], {k, 0, n}];
    a /@ Range[0, 100] (* Jean-François Alcover, Feb 28 2020, after Chai Wah Wu *)
  • PARI
    a(n)=my(s=1,k); while(n, n>>=valuation(n,2); k=valuation(n+1,2); if(k>1, s*=fibonacci(k+1)); n>>=k); s \\ Charles R Greathouse IV, Oct 21 2016
    
  • PARI
    a(n)=sum(k=0,n, !bitand(n-3*k,2*k) && !bitand(n-k,k)) \\ Charles R Greathouse IV, Oct 21 2016
    
  • Python
    def A246028(n): return sum(int(not (~(n-k) & 2*k) | (~n & k)) for k in range(n+1)) # Chai Wah Wu, Sep 27 2021

Formula

a(n) = Sum_{k=0..n} ((binomial(n-k,2k)*binomial(n,k)) mod 2). - Chai Wah Wu, Oct 19 2016

A385215 Number of maximal sparse submultisets of the prime indices of n, where a multiset is sparse iff 1 is not a first difference.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1
Offset: 1

Views

Author

Gus Wiseman, Jul 03 2025

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sparse submultisets of the prime indices of n = 8 are {{},{1},{1,1},{1,1,1}}, with maximization {{1,1,1}}. So a(8) = 1.
The sparse submultisets of the prime indices of n = 462 are {{},{1},{2},{4},{5},{1,4},{2,4},{1,5},{2,5}}, with maximization {{1,4},{1,5},{2,4},{2,5}}, so a(462) = 4.
The prime indices of n together their a(n) maximal sparse submultisets for n = 1, 6, 210, 462, 30030, 46410:
  {}  {1,2}  {1,2,3,4}  {1,2,4,5}  {1,2,3,4,5,6}  {1,2,3,4,6,7}
  ------------------------------------------------------------
  {}   {1}     {1,3}      {1,4}       {2,5}          {1,3,6}
       {2}     {1,4}      {1,5}       {1,3,5}        {1,3,7}
               {2,4}      {2,4}       {1,3,6}        {1,4,6}
                          {2,5}       {1,4,6}        {1,4,7}
                                      {2,4,6}        {2,4,6}
                                                     {2,4,7}
		

Crossrefs

This is the maximal case of A166469.
For binary instead of prime indices we have A384883, maximal case of A245564.
The greatest number whose prime indices are one of these submultisets is A385216.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A384887 counts partitions with equal lengths of gapless runs, distinct A384884.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    maxq[els_]:=Select[els,Not[Or@@Table[Divisible[oth,#],{oth,DeleteCases[els,#]}]]&];
    Table[Length[maxq[Select[Divisors[n],FreeQ[Differences[prix[#]],1]&]]],{n,30}]

Formula

a(n) <= A166469(n).

A385216 Greatest Heinz number of a sparse submultiset of the prime indices of n, where a multiset is sparse iff 1 is not a first difference.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 10, 11, 4, 13, 14, 5, 16, 17, 9, 19, 20, 21, 22, 23, 8, 25, 26, 27, 28, 29, 10, 31, 32, 33, 34, 7, 9, 37, 38, 39, 40, 41, 21, 43, 44, 9, 46, 47, 16, 49, 50, 51, 52, 53, 27, 55, 56, 57, 58, 59, 20, 61, 62, 63, 64, 65, 33, 67, 68, 69
Offset: 1

Views

Author

Gus Wiseman, Jul 05 2025

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The prime indices of 12 are {1,1,2}, with sparse submultisets {{},{1},{2},{1,1}}, with Heinz numbers {1,2,3,4}, so a(12) = 4.
The prime indices of 36 are {1,1,2,2}, with sparse submultisets {{},{1},{2},{1,1},{2,2}}, with Heinz numbers {1,2,3,4,9}, so a(36) = 9.
The prime indices of 462 are {1,2,4,5}, with sparse submultisets {{},{1},{2},{4},{5},{1,4},{2,4},{1,5},{2,5}}, with Heinz numbers {1,2,3,7,11,14,21,22,33}, so a(462) = 33.
		

Crossrefs

Sparse submultisets are counted by A166469, maximal A385215.
The union is A319630 (Heinz numbers of sparse multisets), complement A104210.
For binary instead of prime indices we have A374356, see A245564, A384883.
A000005 counts divisors (or submultisets of prime indices).
A001222 counts prime factors, distinct A001221.
A051903 gives greatest prime exponent, least A051904, counted by A091602.
A055396 gives least prime index, greatest A061395, counted by A008284.
A056239 adds up prime indices, row sums of A112798.
A212166 ranks partitions with max multiplicity = length, counted by A239964.
A381542 ranks partitions with max part = max multiplicity, counted by A240312.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Max@@Select[Divisors[n],FreeQ[Differences[prix[#]],1]&],{n,100}]

Formula

a(n) = n iff n belongs to A319630.
Showing 1-6 of 6 results.