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-10 of 14 results. Next

A260443 Prime factorization representation of Stern polynomials: a(0) = 1, a(1) = 2, a(2n) = A003961(a(n)), a(2n+1) = a(n)*a(n+1).

Original entry on oeis.org

1, 2, 3, 6, 5, 18, 15, 30, 7, 90, 75, 270, 35, 450, 105, 210, 11, 630, 525, 6750, 245, 20250, 2625, 9450, 77, 15750, 3675, 47250, 385, 22050, 1155, 2310, 13, 6930, 5775, 330750, 2695, 3543750, 128625, 1653750, 847, 4961250, 643125, 53156250, 18865, 24806250, 202125, 727650, 143, 1212750, 282975, 57881250, 29645, 173643750, 1414875, 18191250, 1001
Offset: 0

Views

Author

Antti Karttunen, Jul 28 2015

Keywords

Comments

The exponents in the prime factorization of term a(n) give the coefficients of the n-th Stern polynomial. See A125184 and the examples.
None of the terms have prime gaps in their factorization, i.e., all can be found in A073491.
Contains neither perfect squares nor prime powers with exponent > 1. A277701 gives the positions of the terms that are 2*square. - Antti Karttunen, Oct 27 2016
Many of the derived sequences (like A002487) have similar "Fir forest" or "Gaudian cathedrals" style scatter plot. - Antti Karttunen, Mar 21 2017

Examples

			n    a(n)   prime factorization    Stern polynomial
------------------------------------------------------------
0       1   (empty)                B_0(x) = 0
1       2   p_1                    B_1(x) = 1
2       3   p_2                    B_2(x) = x
3       6   p_2 * p_1              B_3(x) = x + 1
4       5   p_3                    B_4(x) = x^2
5      18   p_2^2 * p_1            B_5(x) = 2x + 1
6      15   p_3 * p_2              B_6(x) = x^2 + x
7      30   p_3 * p_2 * p_1        B_7(x) = x^2 + x + 1
8       7   p_4                    B_8(x) = x^3
9      90   p_3 * p_2^2 * p_1      B_9(x) = x^2 + 2x + 1
		

Crossrefs

Same sequence sorted into ascending order: A260442.
Cf. also A048675, A277333 (left inverses).
Cf. A277323, A277324 (bisections), A277200 (even terms sorted), A277197 (first differences), A277198.
Cf. A277316 (values at primes), A277318.
Cf. A023758 (positions of squarefree terms), A101082 (of terms not squarefree), A277702 (positions of records), A277703 (their values).
Cf. A283992, A283993 (number of irreducible, reducible polynomials in range 1 .. n).
Cf. also A206296 (Fibonacci polynomials similarly represented).

Programs

  • Maple
    b:= n-> mul(nextprime(i[1])^i[2], i=ifactors(n)[2]):
    a:= proc(n) option remember; `if`(n<2, n+1,
          `if`(irem(n, 2, 'h')=0, b(a(h)), a(h)*a(n-h)))
        end:
    seq(a(n), n=0..56);  # Alois P. Heinz, Jul 04 2024
  • Mathematica
    a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; Table[a@ n, {n, 0, 56}] (* Michael De Vlieger, Apr 05 2017 *)
  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2)))); \\ After Charles R Greathouse IV's code for "ps" in A186891.
    \\ Antti Karttunen, Oct 11 2016
    
  • Python
    from sympy import factorint, prime, primepi
    from functools import reduce
    from operator import mul
    def a003961(n):
        F = factorint(n)
        return 1 if n==1 else reduce(mul, (prime(primepi(i) + 1)**F[i] for i in F))
    def a(n): return n + 1 if n<2 else a003961(a(n//2)) if n%2==0 else a((n - 1)//2)*a((n + 1)//2)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 21 2017
  • Scheme
    ;; Uses memoization-macro definec:
    (definec (A260443 n) (cond ((<= n 1) (+ 1 n)) ((even? n) (A003961 (A260443 (/ n 2)))) (else (* (A260443 (/ (- n 1) 2)) (A260443 (/ (+ n 1) 2))))))
    ;; A more standalone version added Oct 10 2016, requiring only an implementation of A000040 and the memoization-macro definec:
    (define (A260443 n) (product_primes_to_kth_powers (A260443as_coeff_list n)))
    (define (product_primes_to_kth_powers nums) (let loop ((p 1) (nums nums) (i 1)) (cond ((null? nums) p) (else (loop (* p (expt (A000040 i) (car nums))) (cdr nums) (+ 1 i))))))
    (definec (A260443as_coeff_list n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_coeff_list (/ n 2)))) (else (add_two_lists (A260443as_coeff_list (/ (- n 1) 2)) (A260443as_coeff_list (/ (+ n 1) 2))))))
    (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    

Formula

a(0) = 1, a(1) = 2, a(2n) = A003961(a(n)), a(2n+1) = a(n)*a(n+1).
Other identities. For all n >= 0:
A001221(a(n)) = A277314(n). [#nonzero coefficients in each polynomial.]
A001222(a(n)) = A002487(n). [When each polynomial is evaluated at x=1.]
A048675(a(n)) = n. [at x=2.]
A090880(a(n)) = A178590(n). [at x=3.]
A248663(a(n)) = A264977(n). [at x=2 over the field GF(2).]
A276075(a(n)) = A276081(n). ["at factorials".]
A156552(a(n)) = A277020(n). [Converted to "unary-binary" encoding.]
A051903(a(n)) = A277315(n). [Maximal coefficient.]
A277322(a(n)) = A277013(n). [Number of irreducible polynomial factors.]
A005361(a(n)) = A277325(n). [Product of nonzero coefficients.]
A072411(a(n)) = A277326(n). [And their LCM.]
A007913(a(n)) = A277330(n). [The squarefree part.]
A000005(a(n)) = A277705(n). [Number of divisors.]
A046523(a(n)) = A278243(n). [Filter-sequence.]
A284010(a(n)) = A284011(n). [True for n > 1. Another filter-sequence.]
A003415(a(n)) = A278544(n). [Arithmetic derivative.]
A056239(a(n)) = A278530(n). [Weighted sum of coefficients.]
A097249(a(n)) = A277899(n).
a(A000079(n)) = A000040(n+1).
a(A000225(n)) = A002110(n).
a(A000051(n)) = 3*A002110(n).
For n >= 1, a(A000918(n)) = A070826(n).
A007949(a(n)) is the interleaving of A000035 and A005811, probably A101979.
A061395(a(n)) = A277329(n).
Also, for all n >= 1:
A055396(a(n)) = A001511(n).
A252735(a(n)) = A061395(a(n)) - 1 = A057526(n).
a(A000040(n)) = A277316(n).
a(A186891(1+n)) = A277318(n). [Subsequence for irreducible polynomials].

Extensions

More linking formulas added by Antti Karttunen, Mar 21 2017

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

A062289 Numbers n such that n-th row in Pascal triangle contains an even number, i.e., A048967(n) > 0.

Original entry on oeis.org

2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77
Offset: 1

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 02 2001

Keywords

Comments

Numbers n such that binary representation contains the bit string "10". Union of A043569 and A101082. - Rick L. Shepherd, Nov 29 2004
The asymptotic density of this sequence is 1 (Burns, 2016). - Amiram Eldar, Jan 26 2021

Crossrefs

Complement of A000225, so these might be called non-Mersenne numbers.
A132782 is a subsequence.

Programs

  • Haskell
    a062289 n = a062289_list !! (n-1)
    a062289_list = 2 : g 2 where
       g n = nM n : g (n+1)
       nM k = maximum $ map (\i -> i + min i (a062289 $ k-i+1)) [2..k]
       -- Cf. link [Oliver Kullmann, Xishun Zhao], Def. 3.1, page 3.
    -- Reinhard Zumkeller, Feb 21 2012, Dec 31 2010
    
  • Mathematica
    ok[n_] := MatchQ[ IntegerDigits[n, 2], {_, 1, 0, _}]; Select[ Range[100], ok] (* Jean-François Alcover, Dec 12 2011, after Rick L. Shepherd *)
  • PARI
    isok(m) = #select(x->((x%2)==0), vector(m+1, k, binomial(m, k-1))); \\ Michel Marcus, Jan 26 2021
    
  • Python
    def A062289(n): return n+(m:=n.bit_length())-(not n>=(1<Chai Wah Wu, Jun 30 2024

Formula

a(n) = A057716(n+1) - 1.
a(n) = 2 if n=1, otherwise max{min{2*i, a(n-i+1) + i}: 1 < i <= n}.
A036987(a(n)) = 0. - Reinhard Zumkeller, Mar 06 2012
A007461(a(n)) mod 2 = 0. - Reinhard Zumkeller, Apr 02 2012
A102370(n) = A105027(a(n)). - Reinhard Zumkeller, Jul 21 2012
A261461(a(n)) = A261922(a(n)). - Reinhard Zumkeller, Sep 17 2015

Extensions

More terms from Rick L. Shepherd, Nov 29 2004

A043569 Numbers whose base-2 representation has exactly 2 runs.

Original entry on oeis.org

2, 4, 6, 8, 12, 14, 16, 24, 28, 30, 32, 48, 56, 60, 62, 64, 96, 112, 120, 124, 126, 128, 192, 224, 240, 248, 252, 254, 256, 384, 448, 480, 496, 504, 508, 510, 512, 768, 896, 960, 992, 1008, 1016, 1020, 1022, 1024, 1536, 1792, 1920, 1984, 2016, 2032, 2040, 2044
Offset: 1

Views

Author

Keywords

Comments

Numbers whose binary representation contains the bit string "10" but not "01". Subsequence of A062289; set difference A062289 minus A101082. - Rick L. Shepherd, Nov 29 2004
Mersenne numbers (A000225) times powers of 2 (A000079). Therefore this sequence contains the even perfect numbers (A000396). - Alonso del Arte, Apr 21 2006

Crossrefs

Programs

  • Maple
    a:=proc(n) local nn,nd: nn:=convert(n,base,2): nd:={seq(nn[j]-nn[j-1],j=2..nops(nn))}: if n=2 then 2 elif nd={0,1} then n else fi end: seq(a(n),n=1..2100); # Emeric Deutsch, Apr 21 2006
  • Mathematica
    Take[Sort[Flatten[Table[(2^x - 1)*(2^y), {x, 32}, {y, 32}]]], 54] (* Alonso del Arte, Apr 21 2006 *)
    Select[Range[2500],Length[Split[IntegerDigits[#,2]]]==2&] (* or *) Select[Range[2500],SequenceCount[IntegerDigits[#,2],{1,0}]>0 && SequenceCount[ IntegerDigits[#,2],{0,1}]==0&] (* Harvey P. Dale, Oct 04 2024 *)
  • Python
    def ok(n): b = bin(n)[2:]; return "10" in b and "01" not in b
    print([m for m in range(2045) if ok(m)]) # Michael S. Branicky, Feb 04 2021
    
  • Python
    def a_next(a_n): t = a_n >> 1; return (a_n | t) + (t & 1)
    a_n = 2; a = []
    for i in range(54): a.append(a_n); a_n = a_next(a_n) # Falk Hüffner, Feb 19 2022

Formula

This sequence is twice A023758. - Franklin T. Adams-Watters, Apr 21 2006
Sum_{n>=1} 1/a(n) = A065442. - Amiram Eldar, Feb 20 2022
A007814(a(n)) = A004736(n). - Lorenzo Sauras Altuzarra, Feb 01 2023

Extensions

More terms from Rick L. Shepherd, Nov 29 2004

A049502 Major index of n, 2nd definition.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(A023758(n)) = 0; a(A101082(n)) > 0. - Reinhard Zumkeller, Jun 17 2015

Examples

			83 = 1010011 has 1's followed by 0's in positions 2 and 5 (reading from the right), so a(83)=7.
		

References

  • D. M. Bressoud, Proofs and Confirmations, Camb. Univ. Press, 1999; cf. p. 89.

Crossrefs

Programs

  • Haskell
    a049502 = f 0 1 where
       f m i x = if x <= 4
                    then m else f (if mod x 4 == 1
                                      then m + i else m) (i + 1) $ div x 2
    -- Reinhard Zumkeller, Jun 17 2015
    
  • Maple
    A049502 := proc(n)
        local a,ndgs,p ;
        a := 0 ;
        ndgs := convert(n,base,2) ;
        for p from 1 to nops(ndgs)-1 do
            if op(p,ndgs)- op(p+1,ndgs) = 1 then
                a := a+p ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 17 2012
  • Mathematica
    Table[Total[Flatten[Position[Partition[Reverse[IntegerDigits[n,2]],2,1],?(#=={1,0}&)]]],{n,0,110}] (* _Harvey P. Dale, Oct 05 2013 *)
    Table[Total[SequencePosition[Reverse[IntegerDigits[n,2]],{1,0}][[All,1]]],{n,0,120}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 26 2020 *)
  • PARI
    a(n)=if(n<5, return(0)); sum(i=0,exponent(n)-1, (bittest(n,i) && !bittest(n,i+1))*(i+1)) \\ Charles R Greathouse IV, Jan 30 2023
  • Python
    def m(n):
        x=bin(int(n))[2:][::-1]
        s=0
        for i in range(1,len(x)):
            if x[i-1]=="1" and x[i]=="0":
                s+=i
        return s
    for i in range(101):
        print(str(i)+" "+str(m(i))) # Indranil Ghosh, Dec 22 2016
    

Formula

Write n in binary; add positions where there are 1's followed by 0's, counting from right.

Extensions

More terms from Erich Friedman, Feb 19 2000

A290365 Numbers that cannot be written as a difference of 3-smooth numbers (A003586).

Original entry on oeis.org

41, 43, 59, 67, 82, 83, 85, 86, 89, 91, 97, 103, 109, 113, 118, 121, 123, 129, 131, 133, 134, 137, 145, 149, 151, 155, 157, 163, 164, 166, 167, 169, 170, 172, 173, 177, 178, 181, 182, 185, 187, 193, 194, 197, 199, 201, 203, 205, 206, 209, 218, 221, 223, 226
Offset: 1

Views

Author

Michel Marcus, Aug 03 2017

Keywords

Comments

Called ndh-numbers in the da Silva et al. link.
From Jon E. Schoenfield, Aug 19 2017: (Start)
If (following da Silva et al.) we refer to these numbers as "ndh-numbers" (meaning that they cannot be expressed as the difference of two "harmonic numbers" [which, in this context, are 3-smooth numbers]), we could refer to the sequence of positive integers that are not in this sequence as "dh-numbers", and say that the set of positive integers <= 100 includes the 11 ndh-numbers listed at the link (i.e., a(1) = 41 through a(11) = 97) and 100 - 11 = 89 dh-numbers. Each of the 89 dh-numbers <= 100 can be written as the difference of two 3-smooth numbers using no 3-smooth number larger than 162 (which is required to obtain the difference 98 = 162 - 64). The table below shows results from checking every difference between two 3-smooth numbers < 10^50 (which seems very nearly certain to capture all differences in [1,10^10]):
.
Number Number
of ndh- of dh-
numbers numbers
in in Largest 3-smooth number required
k [1,10^k] [1,10^k] to obtain a dh-number in [1,10^k]
= ======== ======== ==================================
1 0 10 12 = 3 + 9
2 11 89 162 = 64 + 98
3 522 478 13122 = 12288 + 834
4 8433 1567 531441 = 524288 + 7153
5 96065 3935 6377292 = 6291456 + 85836
6 991699 8301 68024448 = 67108864 + 915584
7 9984463 15537 688747536 = 679477248 + 9270288
8 99973546 26454 7346640384 = 7247757312 + 98883072
.
A101082 gives the numbers that cannot be written as a difference of 2-smooth numbers (i.e., the powers of 2: A000079).
Numbers that cannot be written as a difference of 5-smooth numbers (A051037) appear to be 281, 289, 353, 413, 421, 439, 443, 457, 469, 493, 541, 562, 563, 578, 581, 583, 641, 653, 661, 677, 683, 691, 701, 706, 707, 731, 733, 737, 751, 761, 769, 779, 787, 793, 803, 811, 817, 823, 826, 827, 829, 841, 842, 843, 853, 857, 867, 877, 878, 881, 883, 886, ...
Numbers that cannot be written as a difference of 7-smooth numbers (A002473) appear to be 1849, 2309, 2411, 2483, 2507, 2531, 2629, 2711, 2753, 2843, 2851, 2921, 2941, 3139, 3161, 3167, 3181, 3217, 3229, 3251, 3287, 3289, 3293, 3323, 3379, 3481, 3487, 3541, 3601, 3623, 3653, 3697, 3698, 3709, 3737, 3739, 3803, 3827, 3859, 3877, 3901, 3923, 3947, ...
Numbers that cannot be written as a difference of 11-smooth numbers (A051038) appear to be 9007, 10091, 10531, 10831, 11801, 12197, 12431, 12833, 12941, 13393, 13501, 13619, 13679, 13751, 13907, 13939, 14219, 14423, 14737, 14851, 14893, 15217, 15641, 15767, 15773, 15803, 15959, 16019, 16201, 16241, 16393, 16397, 16417, 16441, 16517, 16559, 16579, ...
(End)

Crossrefs

Programs

  • Mathematica
    terms = 54;
    A3586 = Select[Range[3000], FactorInteger[#][[-1, 1]] <= 3&];
    dd = Union[#[[2]] - #[[1]]& /@ Subsets[A3586, {2}]];
    Complement[Range[u[[-1]]], dd][[1 ;; terms]] (* Jean-François Alcover, Sep 28 2018 *)

Extensions

a(12)-a(54) from Jon E. Schoenfield, Aug 18 2017

A308247 a(n) is the least integer not the difference of two prime(n)-smooth numbers.

Original entry on oeis.org

5, 41, 281, 1849, 9007, 35803
Offset: 1

Views

Author

Keywords

Comments

The known terms have been found by exhaustive search and then proved not to be the difference of prime(n)-smooth numbers using assertions such as +- a(n) !== (modulo m) meaning that no element of the subgroup of Z/m generated by a,b,... added to a(n) is congruent modulo m with an element of the subgroup generated by . For example: <2> +- 41 !== <3> (mod 91) and the fact that 41+1 is not 3-smooth is enough to prove that 41 is not the difference of 3-smooth numbers; <2> + 281 !== <3,5> (mod 13981), <2> - 281 !== <3,5> (mod 76627) and <3> +- 281 !== <2,5> along with the fact that 281+1 is not 5-smooth is enough to show that 281 is not the difference of 5-smooth numbers. The proofs get exponentially harder as n increases. For example, <2, 11> + 9007 !== <3, 5, 7> (mod 308859288230831), or <2,5,7> + 35803 !== <3,11,13> (mod 2219897250633559197203).
The next few terms are conjectured to be 158857, 681179, 2516509, 10772123, 51292187, 186323681; if they were not, they would provide examples of ABC-triples with quality greater than 2.

Examples

			We see that 1 = 2-1, 2 = 4-2, 3 = 4-1, and 4 = 8-4. It is easy to see that 5 is not the difference of two powers of 2, so a(1) = 5. In the same way we can see that all the integers up to 40 are the difference of 3-smooth numbers, but as shown above 41 is not, so a(2)=41.
		

Crossrefs

P-smooth_numbers: A000079, A003586, A051037, A002473, A051038, ...
a(i) is the first term in each of A101082, A290365, A308456, A326318, A326319, A326320.

A308456 Numbers that cannot be written as a difference of 5-smooth numbers (A051037).

Original entry on oeis.org

281, 289, 353, 413, 421, 439, 443, 457, 469, 493, 541, 562, 563, 578, 581, 583, 641, 653, 661, 677, 683, 691, 701, 706, 707, 731, 733, 737, 751, 761, 769, 779, 787, 793, 803, 811, 817, 823, 826, 827, 829, 841, 842, 843, 853, 857, 867, 877, 878, 881, 883, 886
Offset: 1

Views

Author

Keywords

Comments

Terms were found by generating in sequential order the 5-smooth numbers up to some limit and collecting the differences. The first 1000 candidates k were then proved to be correct by showing that each of the following congruences holds:
{5} +- k !== {2,3} mod 205910575871,
{3} +- k !== {2,5} mod 220411358713,
{2} +- k !== {3,5} mod 3019333681,
where {a,b,...} represents the subgroup generated by a,b,... of the multiplicative subgroup modulo m. For a discussion iof this method of proof see A308247.

Examples

			281 = A308247(3) cannot be written as the difference of 5-smooth numbers. All smaller numbers can; for example, 277 = 3^4*5 - 2^7, 271 = 2^3*5^3 - 3^6.
		

Crossrefs

Cf. A051037 (5-smooth numbers).
Cf. numbers not the difference of p-smooth numbers for other values of p: A101082 (p=2), A290365 (p=3), A326318 (p=7), A326319 (p=11), A326320 (p=13).
Cf. A308247.

Programs

  • PARI
    \\ Computes the first N elements in the sequence.
    \\ At least the first 10000 are correct.
    N=100;
    \\computes the multiplicative subgroup generated
    \\by the elements of the vector L modulo m.
    SGR(L,m)={S=[1];for(l=1,length(L),z=znorder(Mod(L[l],m));T=[1];for(t=1,z,s=lift(Mod(L[l],m)^t);if(setsearch(S,s),break,T=concat(T,s);));for(t=1,length(T),S=Set(concat(S,lift(S*Mod(T[t],m))))));S}
    m1=205910575871; L1= SGR([2,3],m1); M1 = SGR([5],m1);
    m2=220411358713; L2= SGR([2,5],m2); M2 = SGR([3],m2);
    m3=  3019333681; L3= SGR([3,5],m3); M3 = SGR([2],m3);
    chkdif(k)={r=1;
       D=1;while(gcd(k/D,30)>1,D*=gcd(k/D,30));
       fordiv(D,d,
         if(vecmax(factor(k/d+1)[,1])<= 5 ,r=0);
         if(r,for(t=1,length(M1),
           if(setsearch(L1,(M1[t]+k/d)%m1),r=0;break)));
         if(r,for(t=1,length(M2),
           if(setsearch(L2,(M2[t]+k/d)%m2),r=0;break)));
         if(r,for(t=1,length(M3),
           if(setsearch(L3,(M3[t]+k/d)%m3),r=0;break)));
         if(r,for(t=1,length(M1),
           if(setsearch(L1,(M1[t]-k/d)%m1),r=0;break)));
         if(r,for(t=1,length(M2),
           if(setsearch(L2,(M2[t]-k/d)%m2),r=0;break)));
         if(r,for(t=1,length(M3),
           if(setsearch(L3,(M3[t]-k/d)%m3),r=0;break)));
         if(r==0, break)
       );
       r
    }
    for(k=1,m3,if(chkdif(k),print1(k,", ");if(N--==0, break))); print();

A326318 Numbers that cannot be written as a difference of 7-smooth numbers (A002473).

Original entry on oeis.org

1849, 2309, 2411, 2483, 2507, 2531, 2629, 2711, 2753, 2843, 2851, 2921, 2941, 3139, 3161, 3167, 3181, 3217, 3229, 3251, 3287, 3289, 3293, 3323, 3379, 3481, 3487, 3541, 3601, 3623, 3653, 3697, 3698, 3709, 3737, 3739, 3803, 3827, 3859, 3877, 3901, 3923, 3947
Offset: 1

Views

Author

Keywords

Comments

Terms were found by generating in sequential order the 7-smooth numbers up to some limit and collecting the differences. The first 100 candidates k were then proved to be correct by showing that each of the following congruences holds:
<2> +- k !== <3, 5, 7> mod 31487336959,
<3> +- k !== <2, 5, 7> mod 121328339431,
<2, 3> +- k !== <5, 7> mod 5699207989579,
<5> +- k !== <2, 3, 7> mod 1206047658673,
<2, 5> +- k !== <3, 7> mod 11174958041,
<3, 5> +- k !== <2, 7> mod 31487336959,
<7> +- k !== <2, 3, 5> mod 1116870318707,
where represents any element in the subgroup generated by a,b,... of the multiplicative subgroup modulo m. For a discussion iof this method of proof see A308247.

Examples

			1849 = A308247(4) cannot be written as the difference of 7-smooth numbers. All smaller numbers can; for example, 281 = 2^5*3^2 - 7, 289 = 2*3*7^2 - 5, ..., 1847 = 3*5^4 - 2^2*7.
		

Crossrefs

Cf. A002473 (7-smooth numbers).
Cf. numbers not the difference of p-smooth numbers for other values of p: A101082 (p=2), A290365 (p=3), A308456 (p=5), A326319 (p=11), A326320 (p=13).
Cf. A308247.

A326319 Numbers that cannot be written as a difference of 11-smooth numbers.

Original entry on oeis.org

9007, 10091, 10531, 10831, 11801, 12197, 12431, 12833, 12941, 13393, 13501, 13619, 13679, 13751, 13907, 13939, 14219, 14423, 14737, 14851, 14893, 15217, 15641, 15767, 15773, 15803, 15959, 16019, 16201, 16241, 16393, 16397, 16417, 16441, 16517, 16559
Offset: 1

Views

Author

Keywords

Comments

Terms were found by generating in sequential order the 11-smooth numbers up to some limit and collecting the differences. The first 100 candidates k were then proved to be correct by showing that each of the following 15 congruences holds:
<2> +- k !== <3, 5, 7, 11> mod 563213996185633,
<3> +- k !== <2, 5, 7, 11> mod 194191394486113583,
<2, 3> +- k !== <5, 7, 11> mod 1762314762258271,
<5> +- k !== <2, 3, 7, 11> mod 220836983154619,
<2, 5> +- k !== <3, 7, 11> mod 2128827364461031,
<3, 5> +- k !== <2, 7, 11> mod 3521575252831519,
<7, 11> +- k !== <2, 3, 5> mod 497846284658749,
<7> +- k !== <2, 3, 5, 11> mod 5489574535421899,
<2, 7> +- k !== <3, 5, 11> mod 6600281111334703,
<3, 7> +- k !== <2, 5, 11> mod 834486158701066937,
<5, 11> +- k !== <2, 3, 7> mod 239190476358328703,
<5, 7> +- k !== <2, 3, 11> mod 3288443009987083,
<3, 11> +- k !== <2, 5, 7> mod 14071029652900961,
<2, 11> +- k !== <3, 5, 7> mod 1762314762258271,
<11> +- k !== <2, 3, 5, 7> mod 411934385702047,
where represents any element in the subgroup generated by a,b,... of the multiplicative subgroup modulo m. For a discussion iof this method of proof see A308247.

Examples

			9007 = A308247(5) cannot be written as the difference of 11-smooth numbers. All smaller numbers can; for example, 1849 = 3^4*5^2 - 2^4*11, 2309 = 2*3^5*5 - 11^2.
		

Crossrefs

Cf. A051038 (11-smooth numbers).
Cf. numbers not the difference of p-smooth numbers for other values of p: A101082 (p=2), A290365 (p=3), A308456 (p=5), A326318 (p=7), A326320 (p=13).
Cf. A308247.
Showing 1-10 of 14 results. Next