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 12 results. Next

A004215 Numbers that are the sum of 4 but no fewer nonzero squares.

Original entry on oeis.org

7, 15, 23, 28, 31, 39, 47, 55, 60, 63, 71, 79, 87, 92, 95, 103, 111, 112, 119, 124, 127, 135, 143, 151, 156, 159, 167, 175, 183, 188, 191, 199, 207, 215, 220, 223, 231, 239, 240, 247, 252, 255, 263, 271, 279, 284, 287, 295, 303, 311, 316, 319, 327, 335, 343
Offset: 1

Views

Author

Keywords

Comments

Lagrange's theorem tells us that each positive integer can be written as a sum of four squares.
If n is in the sequence and k is an odd positive integer then n^k is in the sequence because n^k is of the form 4^i(8j+7). - Farideh Firoozbakht, Nov 23 2006
Numbers whose cubes do not have a partition as a sum of 3 squares. a(n)^3 = A134738(n). - Artur Jasinski, Nov 07 2007
A002828(a(n)) = 4; A025427(a(n)) > 0. - Reinhard Zumkeller, Feb 26 2015
There are infinitely many adjacent pairs (for example, 128n + 111 and 128n + 112 for any n), but never a triple of consecutive integers. - Ivan Neretin, Aug 17 2017
These numbers are called "forbidden numbers" in crystallography: for a cubic crystal, no reflection with index hkl such that h^2 + k^2 + l^2 = a(n) appears in the crystal's diffraction pattern. - A. Timothy Royappa, Aug 11 2021

Examples

			15 is in the sequence because it is the sum of four squares, namely, 3^2 + 2^2 + 1^2 + 1^2, and it can't be expressed as the sum of fewer squares.
16 is not in the sequence, because, although it can be expressed as 2^2 + 2^2 + 2^2 + 2^2, it can also be expressed as 4^2.
		

References

  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 261.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 12.
  • E. Poznanski, 1901. Pierwiastki pierwotne liczb pierwszych. Warszawa, pp. 1-63.
  • W. Sierpiński, 1925. Teorja Liczb. pp. 1-410 (p. 125).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, entry 4181.

Crossrefs

Complement of A000378.
Cf. A000118 (ways to write n as sum of 4 squares), A025427.

Programs

  • Haskell
    a004215 n = a004215_list !! (n-1)
    a004215_list = filter ((== 4) . a002828) [1..]
    -- Reinhard Zumkeller, Feb 26 2015
    
  • Maple
    N:= 1000: # to get all terms <= N
    {seq(seq(4^i * (8*j + 7), j = 0 .. floor((N/4^i - 7)/8)), i = 0 .. floor(log[4](N)))}; # Robert Israel, Sep 02 2014
  • Mathematica
    Sort[Flatten[Table[4^i(8j + 7), {i, 0, 2}, {j, 0, 42}]]] (* Alonso del Arte, Jul 05 2005 *)
    Select[Range[120], Mod[ #/4^IntegerExponent[ #, 4], 8] == 7 &] (* Ant King, Oct 14 2010 *)
  • PARI
    isA004215(n)={ local(fouri,j) ; fouri=1 ; while( n >=7*fouri, if( n % fouri ==0, j= n/fouri -7 ; if( j % 8 ==0, return(1) ) ; ) ; fouri *= 4 ; ) ; return(0) ; } { for(n=1,400, if(isA004215(n), print1(n,",") ; ) ; ) ; } \\ R. J. Mathar, Nov 22 2006
    
  • PARI
    isA004215(n)= n\4^valuation(n,4)%8==7 \\ M. F. Hasler, Mar 18 2011
    
  • Python
    def valuation(n, b):
        v = 0
        while n > 1 and n%b == 0: n //= b; v += 1
        return v
    def ok(n): return n//4**valuation(n, 4)%8 == 7 # after M. F. Hasler
    print(list(filter(ok, range(344)))) # Michael S. Branicky, Jul 15 2021
    
  • Python
    from itertools import count, islice
    def A004215_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not (m:=(~n&n-1).bit_length())&1 and (n>>m)&7==7,count(max(startvalue,1)))
    A004215_list = list(islice(A004215_gen(),30)) # Chai Wah Wu, Jul 09 2022
    
  • Python
    def A004215(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x>>(i<<1))-7>>3)+1 for i in range(x.bit_length()>>1))
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = A055039(n)/2. - Ray Chandler, Jan 30 2009
Numbers of the form 4^i*(8*j+7), i >= 0, j >= 0. [A.-M. Legendre & C. F. Gauss]
Products of the form A000302(i)*A004771(j), i, j >= 0. - R. J. Mathar, Nov 29 2006
a(n) = 6*n + O(log(n)). - Charles R Greathouse IV, Dec 19 2013
Conjecture: The number of terms < 2^n is A023105(n) - 2. - Tilman Neumann, Sep 20 2020

Extensions

More terms from Arlin Anderson (starship1(AT)gmail.com)
Additional comments from Jud McCranie, Mar 19 2000

A023105 Number of distinct quadratic residues mod 2^n.

Original entry on oeis.org

1, 2, 2, 3, 4, 7, 12, 23, 44, 87, 172, 343, 684, 1367, 2732, 5463, 10924, 21847, 43692, 87383, 174764, 349527, 699052, 1398103, 2796204, 5592407, 11184812, 22369623, 44739244, 89478487, 178956972, 357913943, 715827884, 1431655767, 2863311532
Offset: 0

Views

Author

Keywords

Comments

Number of distinct n-digit suffixes of base 2 squares.
a(n) counts the elements of A234000 smaller than 2^n plus the zero: a(7)=23 counts the elements of {0, 1, 4, 9, ..., 113, 121}, for example. - R. J. Mathar, Oct 11 2014
Conjecture: a(n) = 2 + (the number of A004215 entries < 2^n), for n>0. - Tilman Neumann, Sep 20 2020

Crossrefs

Programs

  • Haskell
    a 0 = 1
    a 1 = 2
    a n | even n = 2*a(n-1)-2
    a n | odd  n = 2*a(n-1)-1
    -- James Spahlinger, Oct 07 2012
    
  • Magma
    [Floor((2^n+10)/6): n in [0..30]]; // Vincenzo Librandi, Apr 21 2012
    
  • Mathematica
    CoefficientList[Series[(1-3*x^2-x^3)/((1-x)*(1+x)*(1-2*x)),{x,0,35}],x] (* Vincenzo Librandi, Apr 21 2012 *)
    LinearRecurrence[{2,1,-2},{1,2,2,3},40] (* Harvey P. Dale, Mar 05 2016 *)
  • PARI
    a(n)=(2^n+10)\6 \\ Charles R Greathouse IV, Apr 21 2012
    
  • Python
    def A023105(n): return ((1<Chai Wah Wu, Aug 22 2023
  • SageMath
    [(2^n +9 -(-1)^n -3*bool(n==0))/6 for n in (0..30)] # G. C. Greubel, Aug 10 2022
    

Formula

a(n) = floor( (2^n+10)/6 ).
a(n) = (2^n + 9 - (-1)^n)/6 for n > 0. - David S. Dodson, Jan 06 2013
G.f.: (1-3*x^2-x^3)/((1-x)*(1+x)*(1-2*x)). - Colin Barker, Mar 08 2012
a(0)=1, a(1)=2. a(n) = 2*a(n-1)-2 if n is even, a(n) = 2*a(n-1)-1 if n is odd. - Vincenzo Librandi, Apr 21 2012
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) for n > 0. - Joerg Arndt, Apr 21 2012
a(0)=1, a(1)=2, a(n+2) = a(n+1) + A001045(n) for n >= 1. - Lee Hae-hwang, Jun 16 2014
a(n) = A000224(2^n). - R. J. Mathar, Oct 10 2014
a(n) = A005578(n-1) + 1, n > 0. - Carl Joshua Quines, Jul 17 2019
E.g.f.: (exp(2*x) + 9*exp(x) - 3 - exp(-x))/6. - G. C. Greubel, Aug 10 2022

A191257 a(n) = A067368(n)/2.

Original entry on oeis.org

1, 3, 5, 7, 8, 9, 11, 13, 15, 17, 19, 21, 23, 24, 25, 27, 29, 31, 33, 35, 37, 39, 40, 41, 43, 45, 47, 49, 51, 53, 55, 56, 57, 59, 61, 63, 64, 65, 67, 69, 71, 72, 73, 75, 77, 79, 81, 83, 85, 87, 88, 89, 91, 93, 95, 97, 99, 101, 103, 104, 105, 107, 109, 111, 113, 115, 117, 119, 120, 121, 123, 125, 127, 129, 131, 133, 135, 136, 137, 139, 141, 143
Offset: 1

Views

Author

Clark Kimberling, May 28 2011

Keywords

Comments

From Jianing Song, Sep 21 2018: (Start)
Numbers n such that A191255(n) = 0 or 3. Previous definition was numbers n such that A191255(2*n) = 1, that is, numbers of the form 2^(3t)*s where s is an odd number.
{+-a(n)} gives all nonzero cubes modulo all powers of 2, that is, nonzero cubes over the 2-adic integers. So this sequence is closed under multiplication. (End)
The old entry had the conjecture that a(n) = A067368(n)/2. Jianing Song, Sep 21 2018 showed that this is true, and gave us the simpler definition that we have now used. The conjecture is correct because {a(n)} lists the numbers of the form 2^(3t)*s, and {A067368(n)} lists the numbers of the form 2^(3t+1)*s, where s is an odd number. Note also that a(n) = A213258(n)/4.
The asymptotic density of this sequence is 4/7. - Amiram Eldar, May 31 2024

Crossrefs

Perfect powers over the 2-adic integers:
Squares: positive: A234000; negative: A004215 (negated);
Cubes: this sequence;
Fourth powers: positive: A319281; negative: A319282 (negated).

Programs

  • Mathematica
    t = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0, 2}, 2 -> {0, 3},
          3 -> {0, 1}}] &, {0}, 9] (* A191255 *)
    Flatten[Position[t, 0]] (* A005408, the odds *)
    a = Flatten[Position[t, 1]] (* A067368 *)
    b = Flatten[Position[t, 2]] (* A213258 *)
    a/2  (* A191257 *)
    b/4  (* a/2 *)
  • PARI
    isok(n) = valuation(2*n, 2)%3==1; \\ Altug Alkan, Sep 21 2018
    
  • Python
    def A191257(n):
        def f(x): return n+x-sum(((x>>i)-1>>1)+1 for i in range(0,x.bit_length(),3))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Feb 17 2025

Extensions

Name corrected by Altug Alkan, Apr 03 2018
New name from Jianing Song, Sep 21 2018

A055046 Numbers of the form 4^i*(8*j+3).

Original entry on oeis.org

3, 11, 12, 19, 27, 35, 43, 44, 48, 51, 59, 67, 75, 76, 83, 91, 99, 107, 108, 115, 123, 131, 139, 140, 147, 155, 163, 171, 172, 176, 179, 187, 192, 195, 203, 204, 211, 219, 227, 235, 236, 243, 251, 259, 267, 268, 275, 283, 291, 299, 300, 304, 307, 315, 323, 331, 332
Offset: 1

Views

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

Numbers not of the form x^2+y^2+5z^2.
Also values of n such that numbers of the form x^2+n*y^2 for some integers x, y cannot have prime factor of 2 raised to an odd power. - V. Raman, Dec 18 2013

Crossrefs

Programs

  • Mathematica
    A055046Q[k_] := Mod[k/4^IntegerExponent[k, 4], 8] == 3;
    Select[Range[500], A055046Q] (* Paolo Xausa, Mar 20 2025 *)
  • PARI
    is(n)=n/=4^valuation(n,4); n%8==3 \\ Charles R Greathouse IV and V. Raman, Dec 19 2013
    
  • Python
    from itertools import count, islice
    def A055046_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not (m:=(~n&n-1).bit_length())&1 and (n>>m)&7==3,count(max(startvalue,1)))
    A055046_list = list(islice(A055046_gen(),30)) # Chai Wah Wu, Jul 09 2022
    
  • Python
    def A055046(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x>>(i<<1))-3>>3)+1 for i in range(x.bit_length()>>1))
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = 6n + O(log n). - Charles R Greathouse IV, Dec 19 2013
a(n) = A055043(n)/2. - Chai Wah Wu, Mar 19 2025

A055045 Numbers of the form 4^i*(8*j+5).

Original entry on oeis.org

5, 13, 20, 21, 29, 37, 45, 52, 53, 61, 69, 77, 80, 84, 85, 93, 101, 109, 116, 117, 125, 133, 141, 148, 149, 157, 165, 173, 180, 181, 189, 197, 205, 208, 212, 213, 221, 229, 237, 244, 245, 253, 261, 269, 276, 277, 285, 293, 301, 308, 309, 317, 320, 325, 333, 336, 340, 341
Offset: 1

Views

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

Numbers not of the form x^2+2y^2+6z^2.

Crossrefs

Programs

  • Haskell
    a055045 n = a055045_list !! (n-1)
    a055045_list = filter ((== 5) . (flip mod 8) . f) [1..] where
       f x = if r == 0 then f x' else x  where (x', r) = divMod x 4
    -- Reinhard Zumkeller, Jan 02 2014
    
  • Mathematica
    A055045Q[k_] := Mod[k/4^IntegerExponent[k, 4], 8] == 5;
    Select[Range[500], A055045Q] (* Paolo Xausa, Mar 20 2025 *)
  • PARI
    is(n)=n/=4^valuation(n,4); n%8==5 \\ Charles R Greathouse IV and V. Raman, Dec 19 2013
    
  • Python
    from itertools import count, islice
    def A055045_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not (m:=(~n&n-1).bit_length())&1 and (n>>m)&7==5, count(max(startvalue, 1)))
    A055045_list = list(islice(A055045_gen(), 30)) # Chai Wah Wu, Jul 09 2022
    
  • Python
    def A055045(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x>>(i<<1))-5>>3)+1 for i in range(x.bit_length()>>1))
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = 6n + O(log n). - Charles R Greathouse IV, Dec 19 2013
a(n) = A055042(n)/2. - Chai Wah Wu, Mar 19 2025

A319281 Numbers of the form 16^i*(16*j + 1).

Original entry on oeis.org

1, 16, 17, 33, 49, 65, 81, 97, 113, 129, 145, 161, 177, 193, 209, 225, 241, 256, 257, 272, 273, 289, 305, 321, 337, 353, 369, 385, 401, 417, 433, 449, 465, 481, 497, 513, 528, 529, 545, 561, 577, 593, 609, 625, 641, 657, 673, 689, 705, 721, 737, 753, 769, 784
Offset: 1

Views

Author

Jianing Song, Sep 16 2018

Keywords

Comments

{a(n)} gives all positive fourth powers modulo all powers of 2, that is, positive fourth powers over 2-adic integers. So this sequence is closed under multiplication.

Crossrefs

A158057 is a proper subsequence.
Perfect powers over 2-adic integers:
Squares: positive: A234000; negative: A004215 (negated);
Cubes: A191257;
Fourth powers: positive: this sequence; negative: A319282 (negated).

Programs

  • PARI
    isA319281(n)= n\16^valuation(n, 16)%16==1
    
  • Python
    def A319281(n):
        if n<3: return 15*n-14
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n-1+x-sum((((x>>(i<<2))-1)>>4)+1 for i in range(x.bit_length()>>2))
        return bisection(f,n,n) # Chai Wah Wu, Feb 17 2025

Formula

a(n) = 15*n + O(log(n)).

A334832 Numbers whose squarefree part is congruent to 1 (mod 24).

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 49, 64, 73, 81, 97, 100, 121, 144, 145, 169, 193, 196, 217, 225, 241, 256, 265, 289, 292, 313, 324, 337, 361, 385, 388, 400, 409, 433, 441, 457, 481, 484, 505, 529, 553, 576, 577, 580, 601, 625, 649, 657, 673, 676, 697, 721, 729, 745, 769, 772, 784, 793, 817, 841
Offset: 1

Views

Author

Peter Munn, Jun 15 2020

Keywords

Comments

Closed under multiplication.
The sequence forms a subgroup of the positive integers under the commutative operation A059897(.,.). A059897 has a relevance to squarefree parts that arises from the identity A007913(k*m) = A059897(A007913(k), A007913(m)), where A007913(n) is the squarefree part of n.
The subgroup is one of 8 A059897(.,.) subgroups of the form {k : A007913(k) == 1 (mod m)}. The list seems complete, in anticipation of proof that such sets form subgroups only when m is a divisor of 24 (based on the property described by A. G. Astudillo in A018253). This sequence might be viewed as primitive with respect to the other 7, as the latter correspond to subgroups of its quotient group, in the sense that each one (as a set) is also a union of cosets described below. The 7 include A003159 (m=2), A055047 (m=3), A277549 (m=4), A234000 (m=8) and the trivial A000027 (m=1).
The subgroup has 32 cosets. For each i in {1, 5, 7, 11, 13, 17, 19, 23}, j in {1, 2, 3, 6} there is a coset {n : n = k^2 * (24m + i) * j, k >= 1, m >= 0}. The divisors of 2730 = 2*3*5*7*13 form a transversal. (11, clearly not such a divisor, is in the same coset as 35 = 11 + 24; 17, 19, 23 are in the same cosets as 65, 91, 455 respectively.)
The asymptotic density of this sequence is 1/16. - Amiram Eldar, Mar 08 2021

Examples

			The squarefree part of 26 is 26, which is congruent to 2 (mod 24), so 26 is not in the sequence.
The squarefree part of 292 = 2^2 * 73 is 73, which is congruent to 1 (mod 24), so 292 is in the sequence.
		

Crossrefs

A subgroup under A059897, defined using A007913.
Subsequences: A000290\{0}, A103214, A107008.
Equivalent sequences modulo other members of A018253: A000027 (1), A003159 (2), A055047 (3), A277549 (4), A352272(6), A234000 (8).

Programs

  • Mathematica
    Select[Range[850], Mod[Sqrt[#] /. (c_ : 1)*a_^(b_ : 0) :> (c*a^b)^2, 24] == 1 &] (* Michael De Vlieger, Jun 24 2020 *)
  • PARI
    isok(m) = core(m) % 24 == 1; \\ Peter Munn, Jun 21 2020
    
  • Python
    from sympy import integer_log
    def A334832(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum((x//(i<<(j<<1))-1)//24+1 for i in (9**k for k in range(integer_log(x,9)[0]+1)) for j in range((x//i>>1).bit_length()+1))
        return bisection(f,n,n) # Chai Wah Wu, Mar 21 2025

Formula

{a(n)} = {n : n = k^2 * (24m + 1), k >= 1, m >= 0}.

A233999 Values of n such that numbers of the form x^2+n*y^2 for some integers x, y cannot have prime factor of 7 raised to an odd power.

Original entry on oeis.org

1, 2, 4, 8, 9, 11, 15, 16, 18, 22, 23, 25, 29, 30, 32, 36, 37, 39, 43, 44, 46, 49, 50, 51, 53, 57, 58, 60, 64, 65, 67, 71, 72, 74, 78, 79, 81, 85, 86, 88, 92, 93, 95, 98, 99, 100, 102, 106, 107, 109, 113, 114, 116, 120, 121, 123, 127, 128, 130, 134, 135, 137, 141, 142, 144, 148, 149
Offset: 1

Views

Author

V. Raman, Dec 18 2013

Keywords

Comments

Equivalently, numbers of the form 49^n*(7m+1), 49^n*(7m+2), or 49^n*(7m+4). [Corrected by Charles R Greathouse IV, Jan 12 2017]
From Peter Munn, Feb 08 2024: (Start)
Numbers whose squarefree part is congruent to a (nonzero) quadratic residue modulo 7.
The integers in a subgroup of the positive rationals under multiplication. As such the sequence is closed under multiplication and - where the result is an integer - under division. The subgroup has index 4 and is generated by the primes congruent to a quadratic residue (1, 2 or 4) modulo 7, the square of 7, and 3 times the other primes; that is a generator corresponding to each prime: 2, 3*3, 3*5, 7^2, 11, 3*13, 3*17, 3*19, 23, 29, 3*31, ... .
(End)

Crossrefs

Numbers whose squarefree part is congruent to a coprime quadratic residue modulo k: A003159 (k=2), A055047 (k=3), A277549 (k=4), A352272 (k=6), A234000 (k=8), A334832 (k=24).
First differs from A047350 by including 49.

Programs

  • PARI
    is(n)=n/=49^valuation(n, 49); n%7==1||n%7==2||n%7==4 \\ Charles R Greathouse IV and V. Raman, Dec 19 2013
    
  • PARI
    is_A233999(n)=bittest(22,n/49^valuation(n, 49)%7) \\ - M. F. Hasler, Jan 02 2014
    
  • PARI
    list(lim)=my(v=List(),t,u); forstep(k=1,lim\=1,[1,2,4], listput(v,k)); for(e=1,logint(lim,49), u=49^e; for(i=1,#v, t=u*v[i]; if(t>lim, break); listput(v,t))); Set(v) \\ Charles R Greathouse IV, Jan 12 2017
    
  • Python
    from sympy import integer_log
    def A233999(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c = n+x
            for i in range(integer_log(x,49)[0]+1):
                m = x//49**i
                c -= (m-1)//7+(m-2)//7+(m-4)//7+3
            return c
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = 16n/7 + O(log n). - Charles R Greathouse IV, Jan 12 2017

A319282 Numbers of the form 16^i*(16*j + 15).

Original entry on oeis.org

15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 240, 255, 271, 287, 303, 319, 335, 351, 367, 383, 399, 415, 431, 447, 463, 479, 495, 496, 511, 527, 543, 559, 575, 591, 607, 623, 639, 655, 671, 687, 703, 719, 735, 751, 752, 767, 783, 799, 815
Offset: 1

Views

Author

Jianing Song, Sep 16 2018

Keywords

Comments

{-a(n)} gives all negative fourth powers modulo all powers of 2, that is, negative fourth powers over 2-adic integers.

Crossrefs

A125169 is a proper subsequence.
Perfect powers over 2-adic integers:
Squares: positive: A234000; negative: A004215 (negated);
Cubes: A191257;
Fourth powers: positive: A319281; negative: this sequence (negated).

Programs

  • PARI
    isA319282(n)= n\16^valuation(n, 16)%16==15
    
  • Python
    def A319282(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum((((x>>(i<<2))-15)>>4)+1 for i in range(x.bit_length()>>2))
        return bisection(f,n,n) # Chai Wah Wu, Feb 17 2025

Formula

a(n) = 15*n + O(log(n)).

A055044 Numbers of the form 2^(2i+1)*(8*j+1).

Original entry on oeis.org

2, 8, 18, 32, 34, 50, 66, 72, 82, 98, 114, 128, 130, 136, 146, 162, 178, 194, 200, 210, 226, 242, 258, 264, 274, 288, 290, 306, 322, 328, 338, 354, 370, 386, 392, 402, 418, 434, 450, 456, 466, 482, 498, 512, 514, 520, 530, 544, 546, 562, 578
Offset: 1

Views

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

The asymptotic density of this sequence is 1/12. - Amiram Eldar, Mar 29 2025

Crossrefs

Cf. A234000.

Programs

  • Mathematica
    With[{max = 600}, Flatten[Table[2^(2*i + 1)*(8*j + 1), {i, 0, (Log2[max] - 1)/2}, {j, 0, Floor[(max/2^(2*i + 1) - 1)/8]}]] // Sort] (* Amiram Eldar, Mar 29 2025 *)
  • Python
    def A055044(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x>>(i<<1)+1)-1>>3)+1 for i in range(x.bit_length()+1>>1))
        return bisection(f,n,n) # Chai Wah Wu, Mar 19 2025

Formula

a(n) = 2*A234000(n). - Chai Wah Wu, Mar 19 2025
Showing 1-10 of 12 results. Next