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.

Previous Showing 11-20 of 22 results. Next

A309891 a(n) is the total number of trailing zeros in the representations of n over all bases b >= 2.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 1, 5, 3, 3, 1, 6, 1, 3, 3, 8, 1, 6, 1, 6, 3, 3, 1, 9, 3, 3, 5, 6, 1, 7, 1, 10, 3, 3, 3, 11, 1, 3, 3, 9, 1, 7, 1, 6, 6, 3, 1, 13, 3, 6, 3, 6, 1, 9, 3, 9, 3, 3, 1, 12, 1, 3, 6, 14, 3, 7, 1, 6, 3, 7, 1, 15, 1, 3, 6, 6, 3, 7, 1, 13, 8, 3, 1, 12
Offset: 1

Views

Author

Rémy Sigrist, Aug 21 2019

Keywords

Comments

a(n) depends only on the prime signature of n.
a(n) is the sum of the k-adic valuations of n for k >= 2. - Friedjof Tellkamp, Jan 25 2025

Examples

			For n = 12: 12 has 2 trailing zeros in base 2 (1100), 1 trailing zero in bases 3, 4, 6 and 12 (110, 30, 20, 10) and no trailing zero in other bases, hence a(12) = 1*2 + 4*1 = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, IntegerExponent[n, #] &, # > 1 &], {n, 84}] (* Jon Maiga, Aug 25 2019 *)
  • PARI
    a(n) = sumdiv(n, d, if (d>1, valuation(n,d), 0))
    
  • PARI
    a(n) = {if(n == 1, return(0)); my(f = factor(n)[, 2], res = 0, t = 2, of = f, nf = f >> 1, nd(v) = prod(i = 1, #v, v[i] + 1)); while(Set(of) != [0], res += (nd(of) - nd(nf)) * (t-1); of = nf; t++; nf = f \ t); res} \\ David A. Corneth, Aug 22 2019

Formula

a(n) = Sum_{d|n, d>1} A286561(n,d), where A286561 gives the d-valuation of n.
a(p) = 1 for any prime number p.
a(p^k) = A006218(k) for any k >= 0 and any prime number p.
a(n) = 2^A001221(n) - 1 for any squarefree number n.
a(n) = 3 for any semiprime number n.
a(m*n) >= a(m) + a(n).
a(n) >= A007814(n) + A007949(n) + A235127(n) + A112765(n) + A122841(n) + A214411(n) + A244413(n).
a(n) = A056239(A293514(n)). - Antti Karttunen, Aug 22 2019
a(n) <= A033093(n). - Michel Marcus, Aug 22 2019
a(n) = A169594(n) - 1. - Jon Maiga, Aug 25 2019
From Friedjof Tellkamp, Feb 27 2024: (Start)
G.f.: Sum_{k>=2, j>=1} x^(k^j)/(1-x^(k^j)).
Dirichlet g.f.: zeta(s) * Sum_{k>=1} (zeta(k*s) - 1).
Sum_{n>=1} a(n)/n^2 = Pi^2/8 (A111003). (End)

A217319 Numbers with binary representation ending in 4*k+2 or 4*k+3 zeros.

Original entry on oeis.org

4, 8, 12, 20, 24, 28, 36, 40, 44, 52, 56, 60, 64, 68, 72, 76, 84, 88, 92, 100, 104, 108, 116, 120, 124, 128, 132, 136, 140, 148, 152, 156, 164, 168, 172, 180, 184, 188, 192, 196, 200, 204, 212, 216, 220, 228, 232, 236, 244, 248, 252, 260, 264, 268, 276, 280
Offset: 1

Views

Author

Vladimir Shevelev, Mar 18 2013

Keywords

Comments

Or numbers having infinitary divisor 4, or the same, having factor 4 in Fermi-Dirac representation as a product of distinct terms of A050376.
From Peter Munn, Aug 25 2020: (Start)
Compare the terms, as a set, with A145204\{0} (numbers having 3 as a Fermi-Dirac factor). The self-inverse function defined by A225546 maps the members of either one of these sets 1:1 onto the other set.
Numbers whose 4th-power-free part is divisible by 4.
(End)
Numbers k such that the exponent of the highest power of 4 dividing k, A235127(k), is odd. The asymptotic density of this sequence is 1/5. - Amiram Eldar, Sep 20 2020

Crossrefs

Related to A145204\{0} via A225546.

Programs

  • Maple
    isA007814 := proc(n)
        if modp( A007814(n),4) in {2,3} then
            true ;
        else
            false ;
        end if;
    end proc:
    for n from 1 to 1000 do
        if isA007814(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Nov 22 2023
  • Mathematica
    okQ[n_] := (cnt = Count[ Split[ IntegerDigits[n, 2]] // Last, 0]; k0 = k /. ToRules@ Reduce[ (cnt == 2*k || cnt == 2*k+1), k, Integers]; OddQ[k0]); Select[ Range[312], okQ] (* Jean-François Alcover, Mar 18 2013 *)
    Select[Map[# Boole[IntegerQ[(1/4 (1+#))]||IntegerQ[(1/4 (2+#))]&[Length[Last[Split[IntegerDigits[#,2]]]]]]&,Range[2,500,2]],#>0&]
    Select[Range[280], OddQ @ IntegerExponent[#, 4] &] (* Amiram Eldar, Sep 20 2020 *)
  • Python
    def A217319(n):
        def f(x): return n+x-sum((k:=x>>(m<<1))-(k>>2) for m in range(0,(x.bit_length()+1>>1),2))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m<<2 # Chai Wah Wu, May 25 2025

Formula

Conjecture. For n>=1, a(n) = A171949(n+1).

Extensions

Named edited by David A. Corneth, Sep 22 2020

A025646 Exponent of 4 (value of i) in n-th number of form 4^i*5^j.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 8, 0, 7, 6, 5, 4, 3, 2, 9, 1, 8, 0, 7, 6, 5, 4, 3, 10, 2, 9, 1, 8, 0, 7, 6, 5, 4, 11, 3, 10, 2, 9, 1, 8, 0, 7, 6, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0, 7, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0, 7, 14, 6, 13
Offset: 1

Views

Author

Keywords

Crossrefs

Differs from A025661 at a(1881).

Programs

  • Mathematica
    With[{nn=15},IntegerExponent[#,4]&/@Union[Flatten[Table[4^x 5^y,{x,0,nn},{y,0,nn}]]]] (* Harvey P. Dale, May 10 2019 *)
    With[{max = 10^10}, IntegerExponent[Sort[Flatten[Table[4^i*5^j, {i, 0, Log[4, max]}, {j, 0, Log[5, max/4^i]}]]], 4]] (* Amiram Eldar, Jul 09 2025 *)

Formula

a(n) = A235127(A025617(n)). - Amiram Eldar, Jul 09 2025

A025647 Exponent of 4 (value of i) in n-th number of form 4^i*6^j.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 5, 0, 4, 3, 2, 6, 1, 5, 0, 4, 3, 7, 2, 6, 1, 5, 0, 4, 8, 3, 7, 2, 6, 1, 5, 9, 0, 4, 8, 3, 7, 2, 6, 10, 1, 5, 9, 0, 4, 8, 3, 7, 11, 2, 6, 10, 1, 5, 9, 0, 4, 8, 12, 3, 7, 11, 2, 6, 10, 1, 5, 9, 0, 13, 4, 8, 12, 3, 7, 11, 2, 6, 10, 1, 14, 5, 9, 0, 13, 4, 8, 12, 3, 7, 11, 2
Offset: 1

Views

Author

Keywords

Crossrefs

Differs from A025653 at a(2805).

Programs

  • Mathematica
    With[{max = 10^10}, SortBy[Flatten[Table[{i, j}, {i, 0, Log[4, max]}, {j, 0, Log[6, max/4^i]}], 1], 4^#[[1]] * 6^#[[2]] &][[;; , 1]]] (* Amiram Eldar, Jul 09 2025 *)

Formula

a(n) = A235127(A025618(n)/6^A025658(n)). - Amiram Eldar, Jul 09 2025

A214682 Remove 2's that do not contribute to a factor of 4 from the prime factorization of n.

Original entry on oeis.org

1, 1, 3, 4, 5, 3, 7, 4, 9, 5, 11, 12, 13, 7, 15, 16, 17, 9, 19, 20, 21, 11, 23, 12, 25, 13, 27, 28, 29, 15, 31, 16, 33, 17, 35, 36, 37, 19, 39, 20, 41, 21, 43, 44, 45, 23, 47, 48, 49, 25, 51, 52, 53, 27, 55, 28, 57, 29
Offset: 1

Views

Author

Tyler Ball, Jul 25 2012

Keywords

Comments

In this sequence, the number 4 exhibits some characteristics of a prime number since all extraneous 2's have been removed from the prime factorizations of all other numbers.

Examples

			For n=8, v_4(8)=1, v_2(8)=3, so a(8)=(8*4^1)/(2^3)=4.
For n=12, v_4(12)=1, v_2(12)=2, so a(12)=(12*4^1)/(2^2)=12.
		

Crossrefs

Range of values: A003159.
Missing values: A036554.
A056832, A059895, A073675 are used in a formula defining this sequence.
A059897 is used to express relationship between terms of this sequence.
Cf. A007814 (v_2(n)), A235127 (v_4(n)).

Programs

  • Mathematica
    a[n_] := n/(2^Mod[IntegerExponent[n, 2], 2]); Array[a, 100] (* Amiram Eldar, Dec 09 2020 *)
  • PARI
    a(n)=n>>(valuation(n,2)%2) \\ Charles R Greathouse IV, Jul 26 2012
    
  • Python
    def A214682(n): return n>>1 if (~n&n-1).bit_length()&1 else n # Chai Wah Wu, Jan 09 2023
  • SageMath
    C = []
    for i in [1..n]:
        C.append(i*4^(Integer(i).valuation(4))/2^(Integer(i).valuation(2)))
    

Formula

a(n) = (n*4^(v_4(n)))/(2^(v_2(n))) where v_k(n) is the k-adic valuation of n. That is, v_k(n) is the largest power of k, a, such that k^a divides n.
For n odd, a(n)=n since n has no factors of 2 (or 4).
From Peter Munn, Nov 29 2020: (Start)
a(A003159(n)) = n.
a(A036554(n)) = n/2.
a(n) = n/A056832(n) = n/A059895(n, 2) = min(n, A073675(n)).
a(A059897(n, k)) = A059897(a(n), a(k)). (End)
Multiplicative with a(2^e) = 2^(2*floor(e/2)), and a(p^e) = p^e for odd primes p. - Amiram Eldar, Dec 09 2020
Sum_{k=1..n} a(k) ~ (5/12) * n^2. - Amiram Eldar, Nov 10 2022
Dirichlet g.f.: zeta(s-1)*(2^s+1)/(2^s+2). - Amiram Eldar, Dec 30 2022

A369180 Alternating sum of the k-adic valuations (ruler functions) of n.

Original entry on oeis.org

0, 1, -1, 3, -1, 1, -1, 5, -3, 1, -1, 4, -1, 1, -3, 8, -1, 0, -1, 4, -3, 1, -1, 7, -3, 1, -5, 4, -1, 1, -1, 10, -3, 1, -3, 5, -1, 1, -3, 7, -1, 1, -1, 4, -6, 1, -1, 11, -3, 0, -3, 4, -1, -1, -3, 7, -3, 1, -1, 6, -1, 1, -6, 14, -3, 1, -1, 4, -3, 1, -1, 9, -1, 1, -6, 4, -3, 1
Offset: 1

Views

Author

Friedjof Tellkamp, Jan 15 2024

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add((-1)^i*padic[ordp](n, i), i=2..n):
    seq(a(n), n=1..78);  # Alois P. Heinz, Jan 15 2024
  • Mathematica
    z = 70; Sum[(-1)^k IntegerExponent[Range[z], k], {k, 2, z}]
  • PARI
    a(n) = sum(k=2, n, (-1)^k * valuation(n,k)); \\ Michel Marcus, Jan 18 2024
    
  • PARI
    a(n)=sumdiv(n,k, if(k>1, (-1)^k * valuation(n, k))) \\ Charles R Greathouse IV, Jan 23 2025

Formula

a(n) = Sum_{k=2..n} (-1)^k * valuation(n,k).
a(n) = A007814(n) - A007949(n) + A235127(n) - (...).
G.f.: Sum_{k>=2, j>=1} (-1)^k x^(k^j)/(1-x^(k^j)).
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{n=1..m} a(n) = log(2).
Dirichlet g.f.: zeta(s) * Sum_{k>=1} (1 - eta(ks)).
Sum_{n>=1} a(n)/n^2 = Pi^2/24.

A323921 a(n) = (4^(valuation(n, 4) + 1) - 1) / 3.

Original entry on oeis.org

1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 21, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 21, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 21, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 85, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 21, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 21, 1, 1, 1, 5
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 15 2020

Keywords

Comments

Sum of powers of 4 dividing n.

Crossrefs

Programs

  • Mathematica
    Table[(4^(IntegerExponent[n, 4] + 1) - 1)/3, {n, 1, 100}]
    nmax = 100; CoefficientList[Series[Sum[4^k x^(4^k)/(1 - x^(4^k)), {k, 0, Floor[Log[4, nmax]] + 1}], {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = (4^(valuation(n, 4) + 1) - 1) / 3; \\ Michel Marcus, Jul 09 2022
  • Python
    def A323921(n): return ((1<<((~n&n-1).bit_length()&-2)+2)-1)//3 # Chai Wah Wu, Jul 09 2022
    

Formula

G.f.: Sum_{k>=0} 4^k * x^(4^k) / (1 - x^(4^k)).
L.g.f.: -log(Product_{k>=0} (1 - x^(4^k))).
Dirichlet g.f.: zeta(s) / (1 - 4^(1 - s)).
From Amiram Eldar, Nov 27 2022: (Start)
Multiplicative with a(2^e) = (4^floor((e+2)/2)-1)/3, and a(p^e) = 1 for p != 2.
Sum_{k=1..n} a(k) ~ n*log_4(n) + (1/2 + (gamma - 1)/log(4))*n, where gamma is Euler's constant (A001620). (End)

A258059 Let n = Sum_{i=0..k} d_i*4^i be the base-4 expansion of n, with 0 <= d_i < 4. Then a(n) = minimal i such that d_i is not 1, or k+1 if there is no such i.

Original entry on oeis.org

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

Views

Author

Richard C. Webster, May 17 2015

Keywords

Comments

This is the "General Ruler Sequence Base 4 Focused at 1" of Webster (2015).

Examples

			1 = 0*4+1, so a(1)=1.
7 = 1*4+3, so a(7)=0.
21 = 0*4^3+1*4^2+1*4+1, so a(21)=3.
523 base 10 is 20023 in base 4, so a(523)=0.
1365 base 10 is 111111 in base 4, so a(1365)=6.
		

Crossrefs

The nonzero terms give A263845.
This sequence and A263845 are analogs of the pair of ruler sequences A007814 and A001511.
Cf. A030386.

Programs

  • Haskell
    a258059 = f 0 . a030386_row where
       f i [] = i
       f i (t:ts) = if t == 1 then f (i + 1) ts else i
    -- Reinhard Zumkeller, Nov 08 2015
  • Maple
    f:= proc(n)
      if n mod 4 = 1 then procname((n-1)/4) + 1 else 0 fi
    end proc:
    map(f, [$1..1000]); # Robert Israel, Jun 08 2015
  • PARI
    a(n) = {v = Vecrev(digits(n, 4)); for (i=1, #v, if (v[i] != 1, return (i-1));); return(#v);}
    

Formula

Recurrence: a(1)=1; thereafter a(4*n+1) = a(n)+1, a(4*n+j) = 0 for j = 0,2,3. G.f. g(x) = Sum_{k>=0} k * x^((4^k-1)/3) * (1 + x^(2*4^k) + x^(3*4^k))/(1 - x^(4*4^k)) satisfies g(x) = x*g(x^4) + x/(1-x^4). - Robert Israel, Jun 08 2015

Extensions

Edited by N. J. A. Sloane, Oct 31 2015 and Nov 06 2015.

A339455 a(n) is the X-coordinate of the n-th point of the space filling curve H defined in Comments section; A339456 gives Y-coordinates.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Dec 06 2020

Keywords

Comments

We consider a hexagonal lattice with X-axis and Y-axis as follows:
Y
/
/
0 ---- X
We define the family {H_n, n > 0} as follows:
- T_1 contains the origin (0, 0) and (1, 0), in that order:
+-->--+
O
- for any n > 0, H_{n+1} is built from 4 copies of H_n connected with 2^(n+1) unit segments as follows:
+->-2->-+
\ /
^ v
\ /
+->-1->-+->-4->-+
O / \
v ^
/ \
+->-3->-+
- H is the limit of H_n as n tends to infinity,
- H visits once every unit segment (u, v) where u and v are lattice points and at least one of u or v belongs to the region { (x, y) | x > 0 or x + y > 0 },
- the n-th segment of curve H has length 2^A235127(n).

Crossrefs

Programs

  • PARI
    See Links section.

A358345 a(n) is the number of even square divisors of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2
Offset: 1

Views

Author

Amiram Eldar, Nov 11 2022

Keywords

Comments

First differs from A235127 at n = 36.
The first position of k >= 0 in this sequence is A187941(k)^2.

Crossrefs

Programs

  • Mathematica
    f1[p_, e_] := Floor[e/2] + 1; f2[p_, e_] := If[p == 2, 1, Floor[e/2] + 1]; a[1] = 0; a[n_] := Times @@ f1 @@@ (fct = FactorInteger[n]) - Times @@ f2 @@@ fct; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i=1, #f~, 1+f[i,2]\2) - prod(i=1, #f~, if(f[i,1] == 2, 1, 1+f[i,2]\2))};
    
  • PARI
    a(n) = sumdiv(n, d, if (issquare(d) && !(d%2), 1)); \\ Michel Marcus, Nov 11 2022

Formula

a(n) = A046951(n) - A298735(n).
a(n) = 2 * A046951(n) - A046951(4*n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi^2/24 (A222171).
Previous Showing 11-20 of 22 results. Next