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

A049782 a(n) = (0! + 1! + ... + (n-1)!) mod n.

Original entry on oeis.org

0, 0, 1, 2, 4, 4, 6, 2, 1, 4, 1, 10, 10, 6, 4, 10, 13, 10, 9, 14, 13, 12, 21, 10, 14, 10, 10, 6, 17, 4, 2, 26, 1, 30, 34, 10, 5, 28, 10, 34, 4, 34, 16, 34, 19, 44, 18, 10, 48, 14, 13, 10, 13, 10, 34, 34, 28, 46, 28, 34, 22, 2, 55, 26, 49, 34, 65, 30, 67, 34, 68, 10, 55, 42, 64, 66, 34
Offset: 1

Views

Author

Keywords

Comments

Kurepa's conjecture is that gcd(!n,n!) = 2, n > 1. It is easy to prove that this is equivalent to showing that gcd(p,!p) = 1 for all odd primes p. In Guy, 2nd edition, it is stated that Mijajlovic has tested up to p = 10^6. Subsequently Gallot tested up to 2^26. I have continued up to just above p = 2^27, in fact to p < 144000000. There were no examples found where gcd(p,!p) > 1. - Paul Jobling, Dec 02 2004
According to Kellner, the conjecture has been proved by Barsky and Benzaghou. - T. D. Noe, Dec 02 2004
Barsky and Benzaghou withdrew their proof in 2011. I've extended the search up to 10^9; no counterexample was found. - Milos Tatarevic, Feb 01 2013

References

  • R. K. Guy, Unsolved Problems in Number Theory, B44: is a(n) > 0 for n > 2?

Crossrefs

Note that in the context of this sequence, !n is the left factorial A003422 not the subfactorial A000166.

Programs

  • GAP
    List([1..80], n-> Sum([0..n-1], k-> Factorial(k)) mod n ); # G. C. Greubel, Dec 11 2019
  • Haskell
    a049782 :: Int -> Integer
    a049782 n = (sum $ take n a000142_list) `mod` (fromIntegral n)
    -- Reinhard Zumkeller, Nov 02 2011
    
  • Magma
    [&+[Factorial(k-1): k in [1..n]] mod (n): n in [1..80]]; // Vincenzo Librandi, May 31 2019
    
  • Maple
    a:= proc(n) local c, i, t; c, t:=1, 1;
          for i to n-1 do t:= (t*i) mod n; c:= c+t od; c mod n
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 16 2013
  • Mathematica
    Table[Mod[Sum[ i!, {i, 0, n-1}], n], {n, 80}]
    nn=80; With[{fcts=Accumulate[Range[0,nn]!]},Flatten[Table[Mod[Take[fcts,{n}], n], {n,nn}]]] (* Harvey P. Dale, Sep 22 2011 *)
  • PARI
    a(n)=my(s=1,f=1); for(k=1,n, f=f*k%n; s+=f); s%n \\ Charles R Greathouse IV, Feb 07 2017
    
  • Sage
    [mod(sum(factorial(k) for k in (0..n-1)), n) for n in (1..80)] # G. C. Greubel, Dec 11 2019
    

Formula

a(n) = A003422(n) mod n = !n mod n. - G. C. Greubel, Dec 11 2019

Extensions

More terms from Erich Friedman, who observes that the first 500 terms are nonzero. Independently extended by Stephen A. Silver.

A064383 Integers n >= 1 such that n divides 0!-1!+2!-3!+4!-...+(-1)^{n-1}(n-1)!.

Original entry on oeis.org

1, 2, 4, 5, 10, 13, 20, 26, 37, 52, 65, 74, 130, 148, 185, 260, 370, 463, 481, 740, 926, 962, 1852, 1924, 2315, 2405, 4630, 4810, 6019, 9260, 9620, 12038, 17131, 24076, 30095, 34262, 60190, 68524, 85655, 120380, 171310, 222703, 342620, 445406, 890812, 1113515
Offset: 1

Views

Author

Kevin Buzzard (buzzard(AT)ic.ac.uk), Sep 28 2001

Keywords

Comments

If a is in the sequence, then so are all its positive divisors. If a and b are coprime and in the sequence, then so is their product. Hence in extending the sequence, one may as well just look for primes in the sequence (and then check powers of these primes). Heuristically one might expect a very sparse but infinite set of primes in the sequence, but the largest one I know is p=463 and I've searched up to 600000. This sequence was brought to my attention by David Loeffler.
Also, n such that A000522(n)==1 (mod n^2). - Benoit Cloitre, Apr 15 2003
The primes in this sequence are the same as the terms > 1 in A124779. - Jonathan Sondow, Nov 09 2006
Also, n such that n|A(n-1), where A(0) = 1 and A(k) = k*A(k-1)+1 = A000522(k) for k > 0. - Jonathan Sondow, Dec 22 2006
Michael Mossinghoff has calculated that 2, 5, 13, 37, 463 are the only primes in the sequence up to 150 million. - Jonathan Sondow, Jun 12 2007

Examples

			4 is in the sequence because 4 divides 0!-1!+2!-3!=1-1+2-6=-4.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd ed., Springer-Verlag, 2004, B43.

Crossrefs

Programs

  • Mathematica
    s = 0; Do[ s = s + (-1)^(n)(n)!; If[ Mod[ s, n + 1 ] == 0, Print[ n + 1 ] ], {n, 0, 600000} ]
    Divisors[4454060] (* From Formula above *) (* Harvey P. Dale, Aug 09 2012 *)

Formula

Up to n=600000, these are just the divisors of 4*5*13*37*463.

Extensions

More terms from Sean A. Irvine, Jul 02 2023

A188775 Numbers k such that Sum_{j=1..k} j^j == -1 (mod k).

Original entry on oeis.org

1, 2, 3, 6, 14, 42, 46, 1806, 2185, 4758, 5266, 10895, 24342, 26495, 44063, 52793, 381826, 543026, 547311, 805002
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that A001923(k) == -1 (mod k).
a(21) > 10^7. - Hiroaki Yamanouchi, Aug 25 2015
Numbers k such that k divides A062970(k). - Jianing Song, Feb 03 2019

Examples

			6 is a term because 1^1 + 2^2 + 3^3 + 4^4 + 5^5 + 6^6 = 50069 and 50069 + 1 = 6 * 8345. - _Bernard Schott_, Feb 03 2019
		

Crossrefs

Cf. A128981 (sum == 0 (mod n)), A188776 (sum == 1 (mod n)).
Cf. A057245.

Programs

  • Maple
    isA188775 := proc(n) add( modp(k &^ k,n),k=1..n) ; if modp(%,n) = n-1 then true; else false; end if; end proc:
    for n from 1 do if isA188775(n) then printf("%d\n",n) ; end if; end do: # R. J. Mathar, Apr 10 2011
  • Mathematica
    Union@Table[If[Mod[Sum[PowerMod[i,i,n],{i,1,n}],n]==n-1,Print[n];n],{n,1,10000}]
  • PARI
    f(n)=lift(sum(k=1,n,Mod(k,n)^k));
    for(n=1,10^6,if(f(n)==n-1,print1(n,", "))) \\ Joerg Arndt, Apr 10 2011
    
  • PARI
    m=0;for(n=1,1000,m=m+n^n;if((m+1)%n==0,print1(n,", "))) \\ Jinyuan Wang, Feb 04 2019
    
  • Python
    sum = 0
    for n in range(10000):
        sum += n**n
        if sum % (n+1) == 0:
            print(n+1, end=',')
    # Alex Ratushnyak, May 13 2013

Extensions

a(12)-a(16) from Joerg Arndt, Apr 10 2011
a(17)-a(20) from Lars Blomberg, May 10 2011

A100083 Numbers n such that n divides Sum_{m=1..n} (m+1)!.

Original entry on oeis.org

1, 2, 4, 8, 31, 62, 124, 248, 373, 746, 1492, 2984, 11563, 23126, 46252, 92504
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Nov 08 2004

Keywords

Comments

n | Sum_{m=1..n} (m+1)! => n | Sum_{m=2..n+1} m! => n | Sum_{m=2..n-1} m! for n>2 => Sum_{m=2..n-1+k} m! == 0 (mod n) for all k>=0. If n is present and even, then n/2 is present. - Robert G. Wilson v, Nov 11 2004
The terms occur in groups of 4, in a series of n, 2n, 4n, and 8n. Is there any way of calculating the next term in the reduced series: 1, 31, 373, 11563? - Harvey P. Dale, Jun 11 2013
If n is in the sequence and k|n, then k is also in the sequence. In the other direction, if s and t is in the sequence and gcd(s,t)=1, then n=s*t is also in the sequence. Therefore, we need to check only the prime powers, after which we can easily build the rest of the sequence. The prime powers in the sequence begin with 2, 4, 8, 31, 373, ... - Robert Gerbicz, Jun 11 2013
For any terms in this sequence, their LCM also belongs to this sequence. If a(17) exists, it is prime. - Max Alekseyev, Jun 11 2013
a(17) > 74*10^7. - Lars Blomberg, Jun 15 2013
Integers n such that n | (A003422(n) - 2). - David W. Wilson, Jul 20 2013

Examples

			The first few partial sums of (m+1)!, starting with m=1 are 2, 8, 32, 152, 872, 5912, 46232, 409112. Of these, 2 is divisible by 1; 8 is divisible by 2; 152 is divisible by 4; but 32 is not divisible by 3. Therefore the first few terms of this sequence are 1, 2, 4.
		

Crossrefs

Programs

  • Mathematica
    s = -1; Do[s = s + n!; If[ Mod[s, n] == 0, Print[n]], {n, 50000}] (* Robert G. Wilson v, Nov 15 2004 *)
    Take[Flatten[Select[MapIndexed[List,Accumulate[Range[2,24000]!]], Divisible[#[[1]],#[[2,1]]]&]],{2,-1,2}] (* Harvey P. Dale, Jun 11 2013 *)
  • PARI
    s=0:for(n=1,5000,s=s+(n+1)!: if(s%n==0,print(n)))
    
  • PARI
    is(n)=my(t=Mod(1,n));sum(m=2,n+1,t*=m)==0 \\ Charles R Greathouse IV, Jun 11 2013
    
  • Python
    from itertools import count, islice
    def A100083_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            a, c = 0, 1
            for m in range(2,n):
                c = c*m%n
                if c==0:
                    break
                a = (a+c)%n
            if not a:
                yield n
    A100083_list = list(islice(A100083_gen(),20)) # Chai Wah Wu, Apr 16 2024

Formula

Numbers n such that n | (A007489(n+1)-1), also n | (A003422(n+2)-2), n | A054116(n+1).

Extensions

a(13)-a(14) from Robert G. Wilson v, Nov 15 2004
a(15) from Harvey P. Dale, Jun 11 2013
a(16) from Giovanni Resta, confirmed by Charles R Greathouse IV and Robert G. Wilson v, Jun 11 2013
Edited by Max Alekseyev, Mar 27 2015

A216056 Primes p such that p divides the numerator of Sum( k!/2^k, k=1..p-1 ).

Original entry on oeis.org

234781, 115480283
Offset: 1

Views

Author

N. J. A. Sloane, Aug 30 2012

Keywords

Crossrefs

A225727 Numbers k such that sum of first k primorials (A143293) is divisible by k.

Original entry on oeis.org

1, 3, 17, 51, 967, 2901, 16439, 49317, 147951, 1331559
Offset: 1

Views

Author

Alex Ratushnyak, May 13 2013

Keywords

Comments

a(5) = 967 is a prime,
a(6) = a(5) * 3,
a(7) = a(5) * 17,
a(8) = a(5) * 51,
a(9) = a(5) * 51 * 3,
a(10) = a(5) * 51 * 27.
The next term, if it exists, is greater than 15600000. - Alex Ratushnyak, Jun 16 2013

Examples

			Sum of first 3 primorials is 1+2+6=9, because 9 is divisible by 3, the latter is in the sequence.
Sum of first 17 primorials is A143293(17) = 1955977793053588026279. Because A143293(17) is divisible by 17, the latter is in the sequence.
		

Crossrefs

Programs

  • Python
    primes = [2,3]
    def addPrime(k):
      for p in primes:
        if k%p==0:  return
        if p*p > k:  break
      primes.append(k)
    for n in range(5,1000000,6):
      addPrime(n)
      addPrime(n+2)
    sum_ = 0
    primorial = n = 1
    for p in primes:
      sum_ += primorial
      primorial *= p
      if sum_ % n == 0:  print(n, end=', ')
      n += 1
    
  • Python
    from itertools import chain, accumulate, count, islice
    from operator import mul
    from sympy import prime
    def A225727_gen(): return (i+1 for i, m in enumerate(accumulate(accumulate(chain((1,),(prime(n) for n in count(1))), mul))) if m % (i+1) == 0)
    A225727_list = list(islice(A225727_gen(),6)) # Chai Wah Wu, Feb 23 2022
Showing 1-6 of 6 results.