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.

A023758 Numbers of the form 2^i - 2^j with i >= j.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, 32, 48, 56, 60, 62, 63, 64, 96, 112, 120, 124, 126, 127, 128, 192, 224, 240, 248, 252, 254, 255, 256, 384, 448, 480, 496, 504, 508, 510, 511, 512, 768, 896, 960, 992, 1008, 1016, 1020, 1022, 1023
Offset: 1

Views

Author

Keywords

Comments

Numbers whose digits in base 2 are in nonincreasing order.
Might be called "nialpdromes".
Subset of A077436. Proof: Since a(n) is of the form (2^i-1)*2^j, i,j >= 0, a(n)^2 = (2^(2i) - 2^(i+1))*2^(2j) + 2^(2j) where the first sum term has i-1 one bits and its 2j-th bit is zero, while the second sum term switches the 2j-th bit to one, giving i one bits, as in a(n). - Ralf Stephan, Mar 08 2004
Numbers whose binary representation contains no "01". - Benoit Cloitre, May 23 2004
Every polynomial with coefficients equal to 1 for the leading terms and 0 after that, evaluated at 2. For instance a(13) = x^4 + x^3 + x^2 at 2, a(14) = x^4 + x^3 + x^2 + x at 2. - Ben Paul Thurston, Jan 11 2008
From Gary W. Adamson, Jul 18 2008: (Start)
As a triangle by rows starting:
1;
2, 3;
4, 6, 7;
8, 12, 14, 15;
16, 24, 28, 30, 31;
...,
equals A000012 * A130123 * A000012, where A130123 = (1, 0,2; 0,0,4; 0,0,0,8; ...). Row sums of this triangle = A000337 starting (1, 5, 17, 49, 129, ...). (End)
First differences are A057728 = 1; 1; 1; 1; 2,1; 1; 4,2,1; 1; 8,4,2,1; 1; ... i.e., decreasing powers of 2, separated by another "1". - M. F. Hasler, May 06 2009
Apart from first term, numbers that are powers of 2 or the sum of some consecutive powers of 2. - Omar E. Pol, Feb 14 2013
From Andres Cicuttin, Apr 29 2016: (Start)
Numbers that can be digitally generated with twisted ring (Johnson) counters. This is, the binary digits of a(n) correspond to those stored in a shift register where the input bit of the first bit storage element is the inverted output of the last storage element. After starting with all 0’s, each new state is obtained by rotating the stored bits but inverting at each state transition the last bit that goes to the first position (see link).
Examples: for a(n) represented by three bits
Binary
a(5)= 4 -> 100 last bit = 0
a(6)= 6 -> 110 first bit = 1 (inverted last bit of previous number)
a(7)= 7 -> 111
and for a(n) represented by four bits
Binary
a(8) = 8 -> 1000
a(9) = 12 -> 1100 last bit = 0
a(10)= 14 -> 1110 first bit = 1 (inverted last bit of previous number)
a(11)= 15 -> 1111
(End)
Powers of 2 represented in bases which are terms of this sequence must always contain at least one digit which is also a power of 2. This is because 2^i mod (2^i - 2^j) = 2^j, which means the last digit always cycles through powers of 2 (or if i=j+1 then the first digit is a power of 2 and the rest are trailing zeros). The only known non-member of this sequence with this property is 5. - Ely Golden, Sep 05 2017
Numbers k such that k = 2^(1 + A000523(k)) - 2^A007814(k). - Daniel Starodubtsev, Aug 05 2021
A002260(n) = v(a(n)/2^v(a(n))+1) and A002024(n) = A002260(n) + v(a(n)) where v is the dyadic valuation (i.e., A007814). - Lorenzo Sauras Altuzarra, Feb 01 2023

Examples

			a(22) = 64 = 32 + 32 = 2^5 + a(16) = 2^A003056(20) + a(22-5-1).
a(23) = 96 = 64 + 32 = 2^6 + a(16) = 2^A003056(21) + a(23-6-1).
a(24) = 112 = 64 + 48 = 2^6 + a(17) = 2^A003056(22) + a(24-6-1).
		

Crossrefs

A000337(r) = sum of row T(r, c) with 0 <= c < r. See also A002024, A003056, A140129, A140130, A221975.
Cf. A007088, A130123, A101082 (complement), A340375 (characteristic function).
This is the base-2 version of A064222. First differences are A057728.
Subsequence of A077436, of A129523, of A277704, and of A333762.
Subsequences: A043569 (nonzero even terms, or equally, nonzero terms doubled), A175332, A272615, A335431, A000396 (its even terms only), A324200.
Positions of zeros in A049502, A265397, A277899, A284264.
Positions of ones in A283983, A283989.
Positions of nonzero terms in A341509 (apart from the initial zero).
Positions of squarefree terms in A260443.
Fixed points of A264977, A277711, A283165, A334666.
Distinct terms in A340632.
Cf. also A309758, A309759, A309761 (for analogous sequences).

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a023758 n = a023758_list !! (n-1)
    a023758_list = 0 : f (singleton 1) where
    f s = x : f (if even x then insert z s' else insert z $ insert (z+1) s')
    where z = 2*x; (x, s') = deleteFindMin s
    -- Reinhard Zumkeller, Sep 24 2014, Dec 19 2012
    
  • Maple
    a:=proc(n) local n2,d: n2:=convert(n,base,2): d:={seq(n2[j]-n2[j-1],j=2..nops(n2))}: if n=0 then 0 elif n=1 then 1 elif d={0,1} or d={0} or d={1} then n else fi end: seq(a(n),n=0..2100); # Emeric Deutsch, Apr 22 2006
  • Mathematica
    Union[Flatten[Table[2^i - 2^j, {i, 0, 100}, {j, 0, i}]]] (* T. D. Noe, Mar 15 2011 *)
    Select[Range[0, 2^10], NoneTrue[Differences@ IntegerDigits[#, 2], # > 0 &] &] (* Michael De Vlieger, Sep 05 2017 *)
  • PARI
    for(n=0,2500,if(prod(k=1,length(binary(n))-1,component(binary(n),k)+1-component(binary(n),k+1))>0,print1(n,",")))
    
  • PARI
    A023758(n)= my(r=round(sqrt(2*n--))); (1<<(n-r*(r-1)/2)-1)<<(r*(r+1)/2-n)
    /* or, to illustrate the "decreasing digit" property and analogy to A064222: */
    A023758(n,show=0)={ my(a=0); while(n--, show & print1(a","); a=vecsort(binary(a+1)); a*=vector(#a,j,2^(j-1))~); a} \\ M. F. Hasler, May 06 2009
    
  • PARI
    is(n)=if(n<5,1,n>>=valuation(n,2);n++;n>>valuation(n,2)==1) \\ Charles R Greathouse IV, Jan 04 2016
    
  • PARI
    list(lim)=my(v=List([0]),t); for(i=1,logint(lim\1+1,2), t=2^i-1; while(t<=lim, listput(v,t); t*=2)); Set(v) \\ Charles R Greathouse IV, May 03 2016
    
  • Python
    def a_next(a_n): return (a_n | (a_n >> 1)) + (a_n & 1)
    a_n = 1; a = [0]
    for i in range(55): a.append(a_n); a_n = a_next(a_n) # Falk Hüffner, Feb 19 2022
    
  • Python
    from math import isqrt
    def A023758(n): return (1<<(m:=isqrt(n-1<<3)+1>>1))-(1<<(m*(m+1)-(n-1<<1)>>1)) # Chai Wah Wu, Feb 23 2025

Formula

a(n) = 2^s(n) - 2^((s(n)^2 + s(n) - 2n)/2) where s(n) = ceiling((-1 + sqrt(1+8n))/2). - Sam Alexander, Jan 08 2005
a(n) = 2^k + a(n-k-1) for 1 < n and k = A003056(n-2). The rows of T(r, c) = 2^r-2^c for 0 <= c < r read from right to left produce this sequence: 1; 2, 3; 4, 6, 7; 8, 12, 14, 15; ... - Frank Ellermann, Dec 06 2001
For n > 0, a(n) mod 2 = A010054(n). - Benoit Cloitre, May 23 2004
A140130(a(n)) = 1 and for n > 1: A140129(a(n)) = A002262(n-2). - Reinhard Zumkeller, May 14 2008
a(n+1) = (2^(n - r(r-1)/2) - 1) 2^(r(r+1)/2 - n), where r=round(sqrt(2n)). - M. F. Hasler, May 06 2009
Start with A000225. If k is in the sequence, then so is 2k. - Ralf Stephan, Aug 16 2013
G.f.: (x^2/((2-x)*(1-x)))*(1 + Sum_{k>=0} x^((k^2+k)/2)*(1 + x*(2^k-1))). The sum is related to Jacobi theta functions. - Robert Israel, Feb 24 2015
A049502(a(n)) = 0. - Reinhard Zumkeller, Jun 17 2015
a(n) = a(n-1) + a(n-d)/a(d*(d+1)/2 + 2) if n > 1, d > 0, where d = A002262(n-2). - Yuchun Ji, May 11 2020
A277699(a(n)) = a(n)^2, A306441(a(n)) = a(n+1). - Antti Karttunen, Feb 15 2021 (the latter identity from A306441)
Sum_{n>=2} 1/a(n) = A211705. - Amiram Eldar, Feb 20 2022

Extensions

Definition changed by N. J. A. Sloane, Jan 05 2008

A324201 a(n) = A062457(A000043(n)) = prime(A000043(n))^A000043(n), where A000043 gives the exponent of the n-th Mersenne prime.

Original entry on oeis.org

9, 125, 161051, 410338673, 925103102315013629321, 1271991467017507741703714391419, 49593099428404263766544428188098203, 165163983801975082169196428118414326197216835208154294976154161023
Offset: 1

Views

Author

Antti Karttunen, Feb 18 2019

Keywords

Comments

If there are no odd perfect numbers, then the terms give all solutions n > 1 to A323244(n) = 0.
Conversely, if these are all numbers k > 1 that satisfy A323244(k) = 0 (which can be proved if one can show, for example, that no number in A007916 can satisfy the equation), then no odd perfect numbers exist. See also A336700. - Antti Karttunen, Jan 12 2024

Crossrefs

Subsequence of A001597.
Cf. also A336700, A368989.

Programs

  • Mathematica
    Prime[#]^#&/@MersennePrimeExponent[Range[8]] (* Harvey P. Dale, Mar 15 2024 *)

Formula

a(n) = A062457(A000043(n)).
A323244(a(n)) = 0.
a(n) = A005940(1+A000396(n)). [Provided no odd perfect numbers exist]

A332214 Mersenne-prime fixing variant of permutation A163511: a(n) = A332212(A163511(n)).

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 6, 7, 16, 27, 18, 49, 12, 21, 14, 5, 32, 81, 54, 343, 36, 147, 98, 25, 24, 63, 42, 35, 28, 15, 10, 31, 64, 243, 162, 2401, 108, 1029, 686, 125, 72, 441, 294, 175, 196, 75, 50, 961, 48, 189, 126, 245, 84, 105, 70, 155, 56, 45, 30, 217, 20, 93, 62, 11, 128, 729, 486, 16807, 324, 7203, 4802, 625, 216, 3087, 2058, 875
Offset: 0

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Comments

Any Mersenne prime (A000668) times any power of 2, i.e., sequence A335431, is fixed by this map (note the indexing), including also all even perfect numbers. It is not currently known whether there are any additional fixed points.
Because a(n) has the same prime signature as A163511(n), it implies that applying A046523 and A052409 to this sequence gives the same results as with A163511, namely, sequences A278531 and A365805. - Antti Karttunen, Oct 09 2023

Crossrefs

Cf. A163511, A332211, A332212, A332215 (inverse permutation).
Cf. A278531 [= A046523(a(n))], A290251 [= A001222(a(n))], A365805 [= A052409(a(n))], A366372 [= a(n)-n], A366373 [= gcd(n,a(n))], A366374 (numerator of n/a(n)), A366375 (denominator of n/a(n)), A366376.
Cf. A000043, A000668, A000396, A324200, A335431 (conjectured to give all the fixed points).

Programs

  • PARI
    A332214(n) = A332212(A163511(n));
    
  • PARI
    \\ Needs precomputed data for A332211:
    v332211 = readvec("b332211_to.txt"); \\ Prepared with gawk ' { print $2 } ' < b332211.txt > b332211_to.txt
    A332211(n) = v332211[n];
    A332214(n) = if(!n, 1, my(i=1, p=A332211(i), t=1); while(n>1, if(!(n%2), (t*=p), i++; p=A332211(i)); n >>= 1); (t*p)); \\ Antti Karttunen, Oct 09 2023

Formula

a(n) = A332212(A163511(n)).

A324185 Deficiency of n permuted by A163511: a(n) = A033879(A163511(n)) = 2*A163511(n) - sigma(A163511(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 5, 0, 4, 1, 14, -3, 19, -4, 6, 2, 6, 1, 41, -12, 94, -19, 26, 7, 41, -12, 12, -12, 22, -2, 10, 4, 10, 1, 122, -39, 469, -64, 126, 32, 286, -51, 47, -72, 148, -17, 66, 25, 109, -28, 30, -54, 102, -48, 18, -4, 58, -10, 22, -12, 38, 0, 18, 8, 12, 1, 365, -120, 2344, -199, 626, 157, 2001, -168, 222, -372, 1030, -92, 458, 172, 1198
Offset: 0

Views

Author

Antti Karttunen, Feb 17 2019

Keywords

Comments

If there are no odd perfect numbers, then all n for which a(n) is 0 are given by sequence A324200.

Crossrefs

Programs

  • PARI
    A163511(n) = if(!n,1,my(p=2, t=1); while(n>1, if(!(n%2), (t*=p), p=nextprime(1+p)); n >>= 1); (t*p));
    A033879(n) = (2*n-sigma(n));
    A324185(n) = A033879(A163511(n));
    
  • PARI
    A324184(n) = if(!n,1,my(p=2,mp=p*p,m=1); while(n>1, if(n%2, p=nextprime(1+p); mp = p*p, if((2==n)||!(n%4),mp *= p,m *= (mp-1)/(p-1))); n >>= 1); (m*(mp-1)/(p-1)));
    A324185(n) = (2*A163511(n)) - A324184(n);

Formula

a(n) = A033879(A163511(n)) = 2*A163511(n) - A324184(n) = 2*A163511(n) - A000203(A163511(n)).
For n > 0, a(n) = A324055(A054429(n)).

A332215 Mersenne-prime fixing variant of A243071: a(n) = A243071(A332213(n)).

Original entry on oeis.org

0, 1, 3, 2, 15, 6, 7, 4, 5, 30, 63, 12, 255, 14, 29, 8, 511, 10, 1023, 60, 13, 126, 2047, 24, 23, 510, 9, 28, 4095, 58, 31, 16, 125, 1022, 27, 20, 16383, 2046, 509, 120, 32767, 26, 65535, 252, 57, 4094, 262143, 48, 11, 46, 1021, 1020, 1048575, 18, 119, 56, 2045, 8190, 2097151, 116, 4194303, 62, 25, 32, 503, 250, 8388607, 2044, 4093, 54, 16777215, 40
Offset: 1

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Comments

Any Mersenne prime (A000668) times any power of 2 (i.e., 2^k, for k>=0) is fixed by this sequence, including also all even perfect numbers.
From Antti Karttunen, Jul 10 2020: (Start)
This is a "tuned variant" of A243071, and has many of the same properties.
For example, for n > 1, A007814(a(n)) = A007814(n) - A209229(n), that is, this map preserves the 2-adic valuation of n, except when n is a power of two, in which cases that value is decremented by one, and in particular, a(2^k * n) = 2^k * a(n) for all n > 1. Also, like A243071, this bijection maps primes to the terms of A000225 (binary repunits). However, the "tuning" (A332213) has a specific effect that each Mersenne prime (A000668) is mapped to itself. Therefore the terms of A335431 are fixed by this map. Furthermore, I conjecture that there are no other fixed points. For the starters, see the proof in A335879, which shows that at least none of the terms of A335882 are fixed.
(End)

Crossrefs

Cf. A243071, A332210, A332213, A332214 (inverse permutation), A335431 (conjectured to be all the fixed points), A335879.

Programs

Formula

a(n) = A243071(A332213(n)).
For all n >= 1, a(A335431(n)) = A335431(n), a(A335882(n)) = A335879(n). - Antti Karttunen, Jul 10 2020

A324199 Numbers n such that A324187(n) = 0.

Original entry on oeis.org

0, 6, 60, 98, 108, 928, 930, 946, 1874, 3506, 6688, 7496, 7980, 13640, 14476, 15148, 15956, 27168, 30290, 30292, 32752, 59528, 59986, 60556, 60580, 64338, 65432, 108680, 109732, 119972, 121108, 126280, 126872, 130856, 218276, 229160, 242210, 242306, 438914, 454552, 484420, 484640, 485512, 496904, 507032, 518688, 522848, 523400, 811556, 877636
Offset: 1

Views

Author

Antti Karttunen, Feb 17 2019

Keywords

Comments

Sequence A243071(A001599(k)), k >= 1, sorted into ascending order. See also comments in A324185.
Also positions of zeros in A324189.

Crossrefs

Cf. A324200 (subsequence).

Programs

  • PARI
    for(n=0,2^21,if(0==A324187(n),print1(n,", "))); \\ Uses code from A324187.
Showing 1-6 of 6 results.