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.

A120416 Numbers k such that k^2+1 divides k!.

Original entry on oeis.org

18, 21, 38, 43, 47, 57, 68, 70, 72, 73, 83, 99, 111, 117, 119, 123, 128, 132, 133, 142, 157, 172, 173, 174, 182, 185, 191, 192, 193, 200, 211, 212, 216, 233, 237, 239, 242, 251, 253, 255, 265, 268, 273, 278, 293, 294, 302, 305, 307, 313, 319, 322, 327, 336
Offset: 1

Views

Author

R. J. Mathar, Jul 07 2006

Keywords

Comments

Let Product_j (p_j)^(e_j) be the prime factorization of n^2+1. Then n is in the sequence if and only if for each j, e_j <= Sum_{k>=1} floor(n/(p_j)^k). - Robert Israel, Nov 11 2016
There exist infinitely many natural numbers n such that n^2+1 divides n!, because 2*(5*k-2)^2 is a term for k > 0. - Jinyuan Wang, Feb 06 2019
There are 2082 terms up to 10^4, 22792 up to 10^5, 242421 up to 10^6, 2523043 up to 10^7. Perhaps the asymptotic density is 1 - log(2) = 30.68...%. - Jinyuan Wang, Feb 09 2019

Examples

			For the first number, k=18: 18^2+1=325 divides 18!=6402373705728000.
		

Crossrefs

Programs

  • Maple
    select(t -> t! mod (t^2+1)=0, [$1..1000]); # Robert Israel, Nov 11 2016
  • Mathematica
    Select[Range@ 336, Divisible[#!, #^2 + 1] &] (* Jinyuan Wang, Feb 06 2019 *)
  • PARI
    isok(n) = (n! % (n^2+1) == 0) \\ Michel Marcus, Jul 23 2013
    
  • PARI
    valp(n, p)=my(s); while(n>=p, s += n\=p); s
    is(n)=my(f=factor(n^2+1)); for(i=1, #f~, if(valp(n, f[i, 1])Jinyuan Wang, Feb 06 2019

Formula

k such that A002522(k) | A000142(k).

A270441 Numbers n such that n^3+1 divides n!.

Original entry on oeis.org

17, 31, 50, 68, 69, 75, 80, 101, 103, 122, 147, 155, 159, 160, 164, 170, 173, 179, 182, 212, 230, 231, 236, 257, 263, 264, 274, 278, 293, 302, 325, 327, 335, 353, 362, 373, 374, 381, 394, 407, 411, 424, 431, 437, 440, 451, 459, 467, 471, 472, 485, 491, 495, 500
Offset: 1

Views

Author

José Hernández, Mar 17 2016

Keywords

Comments

There exist infinitely many natural numbers n such that n^3+1 divides n!, because for k > 0, (3*k+1)^2 + 1 and 16*k^4 + 1 are terms. (Edited by Jinyuan Wang, Feb 05 2019)
There are 1738 members up to 10^4, 19912 up to 10^5, 216921 up to 10^6, 2299173 up to 10^7, and 23960698 up to 10^8. Perhaps the asymptotic density is 1 - log 2 = 30.68...%. - Charles R Greathouse IV, Apr 05 2016 (Edited by Jinyuan Wang, Feb 06 2019)

Examples

			a(1) = 17 because 17 is the least natural number n such that n^3+1 | n!.
		

Crossrefs

Programs

  • Maple
    A270441:=n->`if`(n! mod (n^3+1) = 0, n, NULL): seq(A270441(n), n=1..800); # Wesley Ivan Hurt, Apr 02 2016
  • Mathematica
    For[n = 1, n <= 500, n++, If[Mod[n!, n^3 + 1] == 0, Print[n]]]
    Select[Range@ 500, Divisible[#!, #^3 + 1] &] (* Michael De Vlieger, Mar 17 2016 *)
  • PARI
    isok(n) = (n! % (n^3+1)) == 0; \\ Michel Marcus, Mar 17 2016
    
  • PARI
    my(f=1);for(n=2,10^3,f*=n;if(f%(n^3+1)==0,print1(n,", "))); \\ Joerg Arndt, Apr 03 2016
    
  • PARI
    valp(n,p)=my(s); while(n>=p, s += n\=p); s
    is(n)=if(isprime(n+1), return(0)); my(f=factor(n^2-n+1)); for(i=1,#f~, if(valp(n,f[i,1])Charles R Greathouse IV, Apr 04 2016
    
  • Python
    from math import factorial
    for n in range(2,1000):
        if(factorial(n)%(n**3+1)==0):print(n)
    # Soumil Mandal, Apr 03 2016

A166460 Numbers k such that k + (-1)^k is not prime.

Original entry on oeis.org

0, 1, 5, 7, 8, 9, 11, 13, 14, 15, 17, 19, 20, 21, 23, 24, 25, 26, 27, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 59, 61, 62, 63, 64, 65, 67, 68, 69, 71, 73, 74, 75, 76, 77, 79, 80, 81, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 14 2009

Keywords

Comments

This is the complement of A068499 (except that both include 1 as a term).
From Don Reble, Aug 31 2021: (Start)
Proof for all k except 0, 1, 3 with cases
(i) If k is odd and >=5, then k+1 = 2*x, 2 < x < k, k! = k*...*x*...*2*1
A068499: k+1 divides k! : absent
A166460: k-1 is even and composite : present
(ii) If k is even and k+1 is prime,
A068499: k+1 does not divide k! : present
A166460: k+1 is prime : absent
(iii) If k is even and k+1 = p^2 is the square of a (odd) prime, then k+1 >= 3p, k > 2p.
A068499: k! = k*...*2p*...*p*...*1;
k+1 divides k! : absent
A166460: k+1 is composite : present
(iv) If k is even and k+1 is composite but not the square of a prime, then there are two distinct factors x*y = k+1:
3 <= x < y = (k+1)/x < k.
A068499: k! = k*...*y*...*x*...*1:
k+1 divides k! : absent
A166460: k+1 is composite : present
(End)

Examples

			0 + (-1)^0 = 1 is not prime, which adds 0 to the sequence.
5 + (-1)^5 = 4 is not prime, which adds 5 to the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 94], ! PrimeQ[# + (-1)^#] &] (* Michael De Vlieger, Sep 08 2021 *)
  • Python
    from sympy import composite
    def A166460(n): return composite(n-1)-1 if n>2 else n-1 # Chai Wah Wu, Aug 27 2024

Formula

a(n) = A002808(n-1)-1 for n>2. - Chai Wah Wu, Aug 27 2024

Extensions

0 added by R. J. Mathar, Oct 21 2009

A269665 For n>=0, let A_n be the set of natural numbers k such that (k^n + 1) | k!. If A is nonempty, then a(n) is the least element of A_n; otherwise a(n) = 0.

Original entry on oeis.org

2, 5, 18, 17, 1600, 984, 2888, 460747, 99271723, 792174, 32917926
Offset: 0

Views

Author

José Hernández, Mar 02 2016

Keywords

Comments

a(n) is the smallest k such that (k^n + 1) | k! if it exists, otherwise a(n) = 0.

Examples

			For n=2, a(2) is equal to 18 because k=18 is the least natural number k such that (k^2+1)|k! (see A120416).
		

Crossrefs

Programs

  • Mathematica
    For[k = 0, k < 11, k++, x = 0; r = 0; n = 1; While[x != 1, If[Mod[n!, n^k + 1] != 0, x = 0, x = 1; r = n]; n++]; Print[r]]
    Table[SelectFirst[Range[10^4], Divisible[#!, #^n + 1] &], {n, 0, 6}] (* Michael De Vlieger, Mar 04 2016, Version 10 *)
  • PARI
    a(n) = {my(k = 1); while (k! % (k^n+1), k++); k;} \\ Michel Marcus, Mar 03 2016

Extensions

a(7)-a(9) from Hiroaki Yamanouchi, Apr 04 2016
a(10) from Giovanni Resta, Apr 20 2016
Showing 1-4 of 4 results.