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

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

A365103 Number of distinct quartic residues x^4 (mod 4^n), x=0..4^n-1.

Original entry on oeis.org

1, 2, 2, 6, 18, 70, 274, 1094, 4370, 17478, 69906, 279622, 1118482, 4473926, 17895698, 71582790, 286331154, 1145324614, 4581298450, 18325193798, 73300775186, 293203100742, 1172812402962, 4691249611846, 18764998447378
Offset: 0

Views

Author

Albert Mukovskiy, Aug 24 2023

Keywords

Comments

a(n) = A364811(2n).
For n>=2, A319281(a(n)) == 4^n + [n mod 2 == 1].
For n>=2, a(n)=k: [ A319281(k) == 4^n + [n mod 2 == 1] ].

Crossrefs

Programs

  • Mathematica
    a[n_] = Ceiling[4^n/15] + Boole[Mod[n,2]==1]; Array[a, 24]
  • PARI
    a(n) = ceil(4^n/15)+(Mod(n,2)==1);
    
  • Python
    def A365103(n): return len({pow(x,4,1<<(n<<1)) for x in range(1<<(n<<1))}) # Chai Wah Wu, Sep 18 2023

Formula

a(n) = ceiling(4^n/15) + (n mod 2).

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)).

A364811 Number of distinct residues x^4 (mod 2^n), x=0..2^n-1.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 6, 10, 18, 36, 70, 138, 274, 548, 1094, 2186, 4370, 8740, 17478, 34954, 69906, 139812, 279622, 559242, 1118482, 2236964, 4473926
Offset: 0

Views

Author

Albert Mukovskiy, Sep 14 2023

Keywords

Comments

For n>=4, A319281(a(n)) == 2^n + [(n mod 4)>0].
It appears that for n>4: a(n)=2*a(n-1)-2*[(n mod 4)==2]; a(n) = ceiling(2^n/15) - [(n mod 4)==0] + 1.

Crossrefs

Programs

  • Mathematica
    a[n_]:=CountDistinct[Table[PowerMod[x-1, 4, 2^(n-1)], {x, 1, 2^(n-1)}]]; Array[a, 24]
  • PARI
    a(n) = #Set(vector(2^(n-1), x, Mod(x-1, 2^(n-1))^4))
    
  • Python
    def A364811(n): return len({pow(x,4,1<Chai Wah Wu, Sep 17 2023
Showing 1-4 of 4 results.