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

A125121 Sturdy numbers: n such that in binary notation k*n has at least as many 1-bits as n for all k>0.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 28, 30, 31, 32, 33, 34, 35, 36, 40, 42, 45, 48, 49, 51, 56, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 73, 75, 80, 84, 85, 89, 90, 93, 96, 98, 102, 105, 112, 120, 124, 126, 127, 128, 129, 130, 132, 133, 135, 136
Offset: 1

Views

Author

Jonathan Vos Post, Jul 07 2008

Keywords

Comments

Is there some absolute upper limit of k for each n, after which the program can finish the testing loop? - Antti Karttunen, Dec 20 2009
Reply from T. D. Noe, Dec 20 2009: Although theorem 2.1 in the paper by Stolarsky is useful, the seqfan e-mail from Jack Brennen sometime around July 2008 is the key to computing these numbers. "To determine if an odd number N is flimsy, take the finite set of residues of 2^a (mod N). Assume that the number of 1's in the binary representation of N is equal to C. To show that the number is flimsy, find a way to construct zero (mod N) by adding up some number of residues of 2^a (mod N) using less than C terms. To show that the number is sturdy, show that it's impossible to do so." In short, this sequence, though difficult to compute, is well defined.
Numbers of the form 2^m-1 (A000225) is a subsequence. - David A. Corneth, Oct 01 2016

Crossrefs

See A143027 for prime sturdy numbers.

Programs

  • Mathematica
    nmax = 136; kmax = 200; nn = (* numbers for which k exceeds kmax *) {37, 67, 81, 83, 97, 101, 113, 131}; sturdyQ[n_ /; MemberQ[nn, n] || MatchQ[ FactorInteger[ n], {{2, }, {Alternatives @@ nn, 1}}]] = False; sturdyQ[n] := For[k = 2, True, k++, Which[ DigitCount[k*n, 2, 1] < DigitCount[n, 2, 1], Return[False], k > kmax, Return[True]]]; A125121 = Reap[ Do[ If[sturdyQ[n], Sow[n]], {n, 1, nmax}]][[2, 1]] (* Jean-François Alcover, Dec 28 2012 *)
    nmax = 200; Bits[n_Integer] := Count[IntegerDigits[n, 2], 1]; FlimsyQ[ n_Integer] := FlimsyQ[n] = Module[{res, b = Bits[n], k}, If[b <= 2, False, If[EvenQ[n], FlimsyQ[n/2], res = Union[Mod[2^Range[n], n]]; If[ Length[res] == n - 1, True, k = 2; While[k < b && !MemberQ[ Union[ Mod[ Plus @@@ Subsets[res, {k}], n]], 0], k++]; k < b]]]]; Select[Range[nmax], !FlimsyQ[#]&] (* Jean-François Alcover, Feb 11 2016, Almost all this improved code is due to Tony D. Noe, updated Feb 26 2016 *)

Formula

Complement of A005360. - T. D. Noe, Jul 17 2008
2n + o(n) < a(n) < 4n^2, see Stolarsky link. - Charles R Greathouse IV, Aug 07 2015

Extensions

Corrected and extended by T. D. Noe, Jul 17 2008

A143027 Sturdy prime numbers: p such that in binary notation k*p has at least as many 1-bits as p for all k > 0.

Original entry on oeis.org

2, 3, 5, 7, 17, 31, 73, 89, 127, 257, 1801, 2089, 8191, 65537, 131071, 178481, 262657, 524287, 2099863, 616318177, 2147483647, 4432676798593
Offset: 1

Views

Author

T. D. Noe, Jul 17 2008, Jul 21 2008

Keywords

Comments

The primes in A125121. This sequence includes the Fermat primes (A019434), Mersenne primes (A000668) and the three known primes in A051154. It appears that almost all primes are flimsy numbers, A005360.
Odd sturdy primes appear to be the largest primitive prime factor of 2^q-1 for q a prime or prime power. The values of q for the current terms: 2, 4, 3, 8, 5, 9, 11, 16, 25, 29, 13, 32, 17, 23, 27 and 19. The sequence probably continues with 2099863, 6700417, 13264529, 20394401, 97685839.
From T. D. Noe, Mar 01 2010: (Start)
Max Alekseyev reports that 6700417, 13264529, 20394401, and 97685839 are not sturdy because each number divides a number having fewer 1-bits: 6700417 divides 2^32 + 1, 13264529 divides 331613225, 20394401 divides 1611157679, and 97685839 divides 18014398643699713. He conjectures that 616318177 is the next term.
If q is a prime power, q = r^s, then the primitive part of 2^q-1 is (2^r^s-1)/(2^r^(s-1)-1). According to Stolarsky's Theorem 2.1, this primitive part is sturdy. If the primitive part is prime, then it is in this sequence. Hence 7^2 produces the sturdy prime 4432676798593 and 59^2 produces a 1031-digit sturdy prime. (End)
Clokie et al. verify that the next two sturdy primes after 2099863 are 616318177 and 2147483647. These are all up to 2^32. Two additional sturdy primes are 57912614113275649087721 = (2^83 - 1)/167 and 10350794431055162386718619237468234569 = (2^131 - 1)/263, but probably there are some in between these and 2147483647. Jeffrey Shallit, Feb 10 2020
From Jason Yuen, Mar 30 2024: (Start)
For all x>log_2(p), 1+A000120(p-(2^x mod p)) >= A000120(p). This follows from the fact that 2^x+p-(2^x mod p) is a multiple of p.
a(23) > 5*10^12. See a143027_5e12.txt for more details. (End)

Crossrefs

Extensions

2089 and 8191 were found by Ray Chandler
2099863 added by T. D. Noe, Mar 01 2010
616318177, 2147483647 added by Jeffrey Shallit, Feb 10 2020
4432676798593 added by Jason Yuen, Mar 30 2024

A086342 Smallest number of 1's in binary expansion of any positive multiple of n.

Original entry on oeis.org

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

Views

Author

Sean A. Irvine, Sep 02 2003

Keywords

Comments

If n is a power of 2 then a(n)=1. All other positive n have a(n)>1. a(n)=2 precisely in cases where some multiple of n is a factor of 2^q+1 for some q.

Examples

			a(n)=2 for n=53, 59, 61, 67, 81, 97 and 101 because n divides 2^k+1 for k=26, 29, 30, 33, 27, 24 and 50, respectively. - _T. D. Noe_, Jul 22 2008
		

Crossrefs

Cf. A005360 (flimsy numbers), A125121 (sturdy numbers), A143069 (least multiple).

Programs

  • PARI
    a(n)=if(!n, return(0)); n>>=valuation(n,2); my(o=znorder(Mod(2, n)), v1=Set(powers(Mod(2, n), o)), v=v1, s=1); while(!setsearch(v, Mod(0, n)), v=setbinop((x, y)->x+y, v, v1); s++); s \\ Charles R Greathouse IV, Dec 07 2016

Formula

a(2^k-1) = k. - Thomas Dybdahl Ahle, May 01 2013

Extensions

More terms from Robert G. Wilson v, Feb 21 2005
Corrected by T. D. Noe, Jul 22 2008
An incorrect Mathematica program was deleted Aug 01 2008

A143073 Least number k such that the binary expansion of n*k has fewer ones than n, or 0 if no such k exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, 27, 0, 0, 3, 3, 0, 41, 5, 3, 0, 5, 0, 0, 0, 0, 0, 0, 0, 7085, 27, 7, 0, 25, 0, 3, 3, 0, 3, 3, 0, 0, 41, 0, 5, 5, 3, 3, 0, 9, 5, 3, 0, 5, 0, 0, 0, 0, 0, 128207979, 0, 0, 0, 119, 0, 0, 7085, 0, 27, 5, 7, 7, 0, 1657009, 25, 395, 0, 0, 3, 3, 3, 0, 0
Offset: 1

Views

Author

T. D. Noe, Jul 22 2008

Keywords

Comments

a(n)=0 indicates that n is a sturdy number (A125121); that is, no multiple of n has fewer ones than the binary expansion of n. If a(n)>0, n is a flimsy number (A005360). Compare with A143069.

A180055 Numbers k such that in binary expansion, the number of 1's in 5*k is less than the number of 1's in k.

Original entry on oeis.org

13, 26, 29, 52, 53, 55, 58, 61, 77, 103, 104, 106, 109, 110, 111, 116, 117, 119, 122, 125, 154, 157, 205, 206, 207, 208, 212, 213, 215, 218, 219, 220, 221, 222, 223, 231, 232, 234, 237, 238, 239, 244, 245, 247, 250, 253, 308, 309, 311, 314, 317, 333, 359, 365
Offset: 1

Views

Author

Zak Seidov, Aug 08 2010

Keywords

Comments

Or, binary weight of 5*k is less than binary weight of k.
Numbers k such that A000120(k) > A000120(5*k).
Also called the 5-flimsy numbers; see the Stolarsky reference.
If m is here, 2m is too. Hence the "primitive solutions" are all odd ones: 13,29,53,55,61,77,103,109,111,117,119,125,157,205,207,213,215,219,221,223,231, ...

Crossrefs

Programs

  • Maple
    filter:= proc(k) convert(convert(5*k,base,2),`+`) < convert(convert(k,base,2),`+`) end proc:
    select(filter, [$1..1000]); # Robert Israel, Jul 29 2025
  • Mathematica
    Select[Range[1000],Count[IntegerDigits[5#,2],1]Amiram Eldar, Jul 29 2025 *)
  • PARI
    for(k=1,370, if(hammingweight(5*k) < hammingweight(k), print1(k,", "))) \\ Hugo Pfoertner, Dec 27 2019
Showing 1-5 of 5 results.