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.

A118478 a(n) is the smallest m such that m*(m+1) is divisible by the first n prime numbers.

Original entry on oeis.org

1, 2, 5, 14, 209, 714, 714, 62985, 367080, 728364, 64822394, 1306238010, 11182598504, 715041747420, 51913478860880, 454746157008780, 9314160363311804, 261062105979210899, 261062105979210899, 696537082207206753590, 54097844397380813592485, 286495021083846822067820
Offset: 1

Views

Author

Giovanni Resta, May 05 2006

Keywords

Comments

a(n)*(a(n)+1)/(product of first n primes) = 1, 1, 1, 1, 19, 17, 1, 409, 604, 82, 20951, 229931, 411012, 39080794, 4382914408, ... - Robert G. Wilson v, May 13 2006 [This is now A215021. - N. J. A. Sloane, Aug 02 2012]

Examples

			a(8) = 62985 since 62985*62986 = 2*3*5*7*11*13*17*19*409, i.e., it is divisible by the first 8 prime numbers (2,3,..,19).
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a118478 n = (+ 1) . fromJust $ elemIndex 0 $
                map (flip mod (a002110 n)) $ tail a002378_list
    -- Reinhard Zumkeller, Jun 14 2015
    (Python 3.8+)
    from itertools import combinations
    from math import prod
    from sympy import sieve, prime, primorial
    from sympy.ntheory.modular import crt
    def A118478(n): return 1 if n == 1 else int(min(min(crt((m, (k:=primorial(n))//m), (0, -1))[0], crt((k//m, m), (0, -1))[0]) for m in (prod(d) for l in range(1, n//2+1) for d in combinations(sieve.primerange(prime(n)+1), l)))) # Chai Wah Wu, May 31 2022
  • Mathematica
    f[n_] := Block[{k = 1, p = Times @@ Prime@Range@n}, While[ !IntegerQ@ Sqrt[4k*p + 1], k++ ]; Floor@ Sqrt[k*p]]; Array[f, 15] (* Robert G. Wilson v, May 13 2006 *)
  • PARI
    P=primes(25);T=1;for(n=1,25,T*=P[n];m=T;for(k=2^(n-1),2^n-1,u=binary(k); a=1;for(i=1,n,if(u[i],a*=P[i]));b=T/a;w=bezout(a,b);if(w[1]<=0,w[1]+=b); c=a*w[1]-1;m=min(m,c);w[1]=b-w[1];if(w[1]<=0,w[1]+=b);c=a*w[1];m=min(m,c)); print1(m,",")) \\ Robert Gerbicz, Aug 24 2006
    

Formula

a(n) = Min_{m | m*(m+1) is divisible by A002110(n)}.

Extensions

More terms from Robert Gerbicz, Aug 24 2006

A215085 a(n) = (A214089(n)^2 - 1) divided by four times the product of the first n primes.

Original entry on oeis.org

1, 1, 1, 1, 19, 17, 1, 2567, 3350, 128928, 3706896, 1290179, 100170428, 39080794, 61998759572, 7833495265, 45119290746, 581075656330, 8672770990, 15792702394898740, 594681417768520250, 25509154378676494, 1642780344643617537867, 480931910076867717575
Offset: 1

Views

Author

J. Stauduhar, Aug 02 2012

Keywords

Comments

When floor(A214089(n) / 2) = A118478(n), a(n) = A215021(n).

Examples

			A214089(14) = 1430083494841, n#_14 = 13082761331670030, and (1430083494841^2 - 1) / (4 * 13082761331670030) = 39080794, so a(14) = 39080794.
		

Programs

  • Maple
    A215085 := proc(n)
            (A214089(n)^2-1)/4/A002110(n) ;
    end proc: # R. J. Mathar, Aug 21 2012
  • Python
    from itertools import product
    from sympy import sieve, prime, isprime, primorial
    from sympy.ntheory.modular import crt
    def A215085(n):
        return (
            1
            if n == 1
            else (
                int(
                    min(
                        filter(
                            isprime,
                            (
                                crt(tuple(sieve.primerange(prime(n) + 1)), t)[0]
                                for t in product((1, -1), repeat=n)
                            ),
                        )
                    )
                )
                ** 2
                - 1
            )
            // 4
            // primorial(n)
        )  # Chai Wah Wu, May 31 2022
    for n in range(1, 16):
        print(A215085(n), end=", ")

Formula

a(n) = (A214089(n)^2 - 1) / (4 * A002110(n)).
Showing 1-2 of 2 results.