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.

A370974 A260850 sorted into increasing order and duplicates omitted.

Original entry on oeis.org

1, 2, 6, 20, 24, 120, 140, 858, 924, 1008, 1120, 1430, 10080, 11088, 12012, 22880, 176358, 388960, 1662804, 1750320, 3879876, 4056234, 9694845, 10029150, 10400600, 10816624, 33256080, 270415600, 280816200, 290845350, 300540195, 1037158320, 1452021648, 3181073742, 3267048708, 9617286240, 13784652882, 20583576819, 35263382880, 120880802196
Offset: 1

Views

Author

N. J. A. Sloane, Apr 15 2024

Keywords

Comments

It seems very likely that there are no duplicates in A260850. Compare the proof of the analogous property of A008336.

Crossrefs

A008336 a(n+1) = a(n)/n if n|a(n) else a(n)*n, a(1) = 1.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 20, 140, 1120, 10080, 1008, 11088, 924, 12012, 858, 12870, 205920, 3500640, 194480, 3695120, 184756, 3879876, 176358, 4056234, 97349616, 2433740400, 93605400, 2527345800, 90262350, 2617608150, 87253605, 2704861755, 86555576160, 2856334013280
Offset: 1

Views

Author

Keywords

Comments

The graph of log_10(a(n)+1) seems to suggest that log(a(n)) is asymptotic to C*n where C is approximately 0.8. - Daniel Forgues, Sep 18 2011
Comments from N. J. A. Sloane, Apr 14 2024: (Start)
See A370968 for the terms in increasing order with duplicates omitted.
See A337486 and A195504 for the n such that a(n+1) = a(n)/n.
Guy and Nowakowski give bounds on a(n).
Theorem: 1 is the only repeated term.
Proof: Write a(n) for A008336(n).
Suppose, seeking a contradiction, that for 1 < r < s we have a(r) = a(s).
This means that a(r)*r^e_0*(r+1)^e_1*(r+2)^e_2*...(s-1)^e_t = a(s) = a(r),
where the exponents e_* are +1 or -1. The product (P1, say) of the terms with exponent +1 must equal the product (P2, say) of the terms with exponent -1. Since r>1, we need s >= r+2.
The product P1*P2 = P1^2 of all these terms is (s-1)!/(r-1)!.
But this contradicts Erdos's theorem (Erdos 1939) that the product of two or more consecutive integers is never a square. QED.
(End)

References

  • P. Erdos, On the product of consecutive integers, J. London Math. Soc., 14 (1939), 194-198.

Crossrefs

Cf. A005132 (the original Recaman sequence).
A065422 and A260850 are variants of the present sequence.
Cf. also A195504 = Product of numbers up to n-1 used as divisors in A008336(n), n >= 2; a(1) = 1.
Cf. also A337486, A370968.

Programs

  • Haskell
    a008336 n = a008336_list !! (n-1)
    a008336_list = 1 : zipWith (/*) a008336_list [1..] where
        x /* y = if x `mod` y == 0 then x `div` y else x*y
    -- Reinhard Zumkeller, Feb 22 2012, Oct 25 2010
    
  • Maple
    A008336 := proc(n) option remember; if n = 1 then 1 elif A008336(n-1) mod (n-1) = 0 then A008336(n-1)/(n-1) else A008336(n-1)*(n-1); fi; end;
  • Mathematica
    a[n_] := a[n] = If[ Divisible[ a[n-1], n-1], a[n-1]/(n-1), a[n-1]*(n-1)]; a[1] = 1; Table[a[n], {n, 1, 28}] (* Jean-François Alcover, Dec 02 2011 *)
    nxt[{n_,a_}]:={n+1,If[Divisible[a,n],a/n,n*a]}; Transpose[ NestList[ nxt,{1,1},30]][[2]] (* Harvey P. Dale, May 09 2016 *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A008336(n):
        if n == 1: return 1
        a, b = divmod(c:=A008336(n-1),n-1)
        return c*(n-1) if b else a # Chai Wah Wu, Apr 11 2024

A371906 a(n) = sum of 2^(k-1) such that floor(n/prime(k)) is odd.

Original entry on oeis.org

0, 1, 3, 2, 6, 5, 13, 12, 14, 11, 27, 24, 56, 49, 55, 54, 118, 117, 245, 240, 250, 235, 491, 488, 492, 461, 463, 454, 966, 961, 1985, 1984, 2002, 1939, 1951, 1948, 3996, 3869, 3903, 3898, 7994, 7985, 16177, 16160, 16166, 15911, 32295, 32292, 32300, 32297, 32363
Offset: 1

Views

Author

Michael De Vlieger, Apr 15 2024

Keywords

Comments

The only powers of 2 in the sequence are likely 1 and 2.

Examples

			a(1) = 0 since n = 1 is the empty product.
a(2) = 1 since for n = prime(1) = 2, floor(2/2) = 1 is odd. Therefore a(2) = 2^(1-1) = 1.
a(3) = 3 since for n = 3 and prime(1) = 2, floor(3/2) = 1 is odd, and for prime(2) = 3, floor(3/3) = 1 is odd. Hence a(3) = 2^(1-1) + 2^(2-1) = 1 + 2 = 3.
a(4) = 2 since for n = 4 and prime(1) = 2, floor(4/2) = 2 is even, but for prime(2) = 3, floor(4/3) = 1 is odd. Therefore, a(n) = 2^(2-1) = 2.
a(5) = 6 since for n = 5, though floor(5/2) = 2 is even, floor(5/3) and floor(5/5) are both odd. Therefore, a(n) = 2^(2-1) + 2^(3-1) = 2 + 4 = 6, etc.
Table relating a(n) with b(n), diagramming powers of 2 with "x" that sum to a(n), or prime factors with "x" that produce b(n), where b(n) = A372000(n).
             Power of 2
   n   a(n)  01234567      b(n)
  ----------------------------
   1     0   .               1
   2     1   x               2
   3     3   xx              6
   4     2   .x              3
   5     6   .xx            15
   6     5   x.x            10
   7    13   x.xx           70
   8    12   ..xx           35
   9    14   .xxx          105
  10    11   xx.x           42
  11    27   xx.xx         462
  12    24   ...xx          77
  13    56   ...xxx       1001
  14    49   x...xx        286
  15    55   xxx.xx       4290
  16    54   .xx.xx       2145
  17   118   .xx.xxx     36465
  18   117   x.x.xxx     24310
  19   245   x.x.xxxx   461890
  20   240   ....xxxx    46189
  ----------------------------
                 1111
             23571379
             Prime factor
		

Crossrefs

Programs

  • Mathematica
    Table[Total[2^(-1 + Select[Range@ PrimePi[n], OddQ@ Quotient[n, Prime[#]] &])], {n, 50}]
  • PARI
    a(n) = sum(k=1, primepi(n), if (n\prime(k) % 2, 2^(k-1))); \\ Michel Marcus, Apr 16 2024

A372000 a(n) = product of primes p such that floor(n/p) is odd.

Original entry on oeis.org

1, 2, 6, 3, 15, 10, 70, 35, 105, 42, 462, 77, 1001, 286, 4290, 2145, 36465, 24310, 461890, 46189, 969969, 176358, 4056234, 676039, 3380195, 520030, 1560090, 111435, 3231615, 430882, 13357342, 6678671, 220396143, 25928958, 907513530, 151252255, 5596333435, 589087730, 22974421470, 2297442147
Offset: 1

Views

Author

Michael De Vlieger, Apr 15 2024

Keywords

Comments

The only primes in the sequence are 2 and 3.
We can approach the sequence in a manner akin to A260850, a variant of A008336. Set k = 1. Then for all prime factors p | n, if p | k, divide k by p, otherwise multiply k by p. Then we set a(n) = k. This accounts for the "toggling on or off" of prime factors as n increases.
For n >= 1, A055773(n) | a(n), where A055773(n) = A034386(n) / A034386(floor(n/2)).

Examples

			a(1) = 1 since n = 1 is the empty product.
a(2) = 2 since for n = 2, floor(n/p) = floor(2/2) = 1 is odd.
a(3) = 6 since for n = 3 and p = 2, floor(3/2) = 1 is odd, and for p = 3, floor(3/3) = 1 is odd. Hence a(3) = 2*3 = 6.
a(4) = 3 since for n = 4 and p = 2, floor(4/2) = 2 is even, but for p = 3, floor(4/3) = 1 is odd. Therefore, a(n) = 3.
a(5) = 15 since for n = 5, though floor(5/2) = 2 is even, floor(5/3) and floor(5/5) are both odd. Therefore, a(n) = 3*5 = 15, etc.
Table relating a(n) with b(n), diagramming prime factors with "x" that produce a(n), or powers of 2 with "x" that sum to b(n), where b(n) = A371906(n).
                Prime factor
                    1111
   n      b(n)  23571379   b(n)
  ----------------------------
   1        1   .            0
   2        2   x            1
   3        6   xx           3
   4        3   .x           2
   5       15   .xx          6
   6       10   x.x          5
   7       70   x.xx        13
   8       35   ..xx        12
   9      105   .xxx        14
  10       42   xx.x        11
  11      462   xx.xx       27
  12       77   ...xx       24
  13     1001   ...xxx      56
  14      286   x...xx      49
  15     4290   xxx.xx      55
  16     2145   .xx.xx      54
  17    36465   .xx.xxx    118
  18    24310   x.x.xxx    117
  19   461890   x.x.xxxx   245
  20    46189   ....xxxx   240
  ----------------------------
                01234567
                Power of 2
		

Crossrefs

Programs

  • Mathematica
    Table[Times @@ Select[Prime@ Range@ PrimePi[n], OddQ@ Quotient[n, #] &], {n, 40}] (* or *)
    Table[Product[Prime[i], {j, 1 + Floor[PrimePi[n]/2]}, {i, 1 + PrimePi[Floor[n/(2 j)]], PrimePi[Floor[n/(2 j - 1)]]}], {n, 40}]
  • PARI
    a(n) = vecprod(select(x->((n\x) % 2), primes([1, n]))); \\ Michel Marcus, Apr 16 2024
    
  • SageMath
    print([prod(p for p in prime_range(n + 1) if is_odd(n//p)) for n in range(1, 41)])
    # Peter Luschny, Apr 16 2024

Formula

a(n) = Product_{k = 1..floor(pi(n)/2)+1} Product_{j = 1+floor(n/(2*k))..floor(n/(2*k-1))} prime(j), where pi(x) = A000720(n).
Showing 1-4 of 4 results.