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

A093049 n-1 minus exponent of 2 in n, a(0) = 0.

Original entry on oeis.org

0, 0, 0, 2, 1, 4, 4, 6, 4, 8, 8, 10, 9, 12, 12, 14, 11, 16, 16, 18, 17, 20, 20, 22, 20, 24, 24, 26, 25, 28, 28, 30, 26, 32, 32, 34, 33, 36, 36, 38, 36, 40, 40, 42, 41, 44, 44, 46, 43, 48, 48, 50, 49, 52, 52, 54, 52, 56, 56, 58, 57, 60, 60, 62, 57, 64, 64, 66, 65, 68
Offset: 0

Views

Author

Ralf Stephan, Mar 16 2004

Keywords

Examples

			G.f. = 2*x^3 + x^4 + 4*x^5 + 4*x^6 + 6*x^7 + 4*x^8 + 8*x^9 + 8*x^10 + ... - _Michael Somos_, Jan 25 2020
		

Crossrefs

a(n) = n - A007814(n) - 1 = A093048(n) - 1, n>0.
a(n) is the exponent of 2 in A001761(n+1), A002105(n), A002682(n-1), A006963(n), A036770(n-1), A059837(n), A084623(n), |A003707(n)|, |A011859(n)|.

Programs

  • Mathematica
    a[ n_] := If[ n == 0, 0, n - 1 - IntegerExponent[n, 2]]; (* Michael Somos, Jan 25 2020 *)
  • PARI
    a(n)=if(n<1,0,if(n%2==0,a(n/2)+n/2-1,n-1))
    
  • PARI
    {a(n) = if( n, n - 1 - valuation(n, 2))}; /* Michael Somos, Jan 25 2020 */
    
  • Python
    def A093049(n): return n-1-(~n& n-1).bit_length() if n else 0 # Chai Wah Wu, Jul 07 2022

Formula

Recurrence: a(2n) = a(n) + n - 1, a(2n+1) = 2n.
G.f.: sum(k>=0, t^3(t+2)/(1-t^2)^2, t=x^2^k).

A059836 Triangle T(s,t), s >= 1, 1 <= t <= s (see formula line).

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 1, 3, 9, 18, 1, 4, 16, 48, 144, 1, 5, 25, 100, 400, 1200, 1, 6, 36, 180, 900, 3600, 14400, 1, 7, 49, 294, 1764, 8820, 44100, 176400, 1, 8, 64, 448, 3136, 18816, 112896, 564480, 2822400, 1, 9, 81, 648, 5184, 36288, 254016, 1524096, 9144576
Offset: 1

Views

Author

N. J. A. Sloane, Feb 25 2001

Keywords

Examples

			Triangle begins:
  1;
  1,1;
  1,2,4;
  1,3,9,18;
  ...
		

References

  • S. G. Mikhlin, Constants in Some Inequalities of Analysis, Wiley, NY, 1986, see p. 59.

Crossrefs

Cf. A059837.

Programs

  • Maple
    T := proc(s,t) option remember: if s=1 or t=1 then RETURN(1) fi: if t>1 and t mod 2 = 1 then RETURN(product((s-i)^2, i=1..(t-1)/2)) else RETURN((s-t/2)*product((s-i)^2, i=1..t/2-1)) fi: end: for s from 1 to 15 do for t from 1 to s do printf(`%d,`, T(s,t)) od:od:
  • Mathematica
    T[s_, t_] := If[OddQ[t], Times @@ (s - Range[(t - 1)/2])^2, Times @@ (s - Range[t/2 - 1])^2*(s - t/2)];
    Table[T[s, t], {s, 1, 15}, {t, 1, s}] // Flatten (* Jean-François Alcover, Apr 29 2023 *)

Formula

T(s, t) = (s-1)^2*(s-2)^2*...*(s-(t-1)/2)^2 if t odd, else (s-1)^2*(s-2)^2*...*(s-t/2+1)^2*(s-t/2).

Extensions

More terms from James Sellers, Feb 26 2001 and from Larry Reeves (larryr(AT)acm.org), Feb 26 2001
Showing 1-2 of 2 results.