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-10 of 13 results. Next

A181121 As n increases, the reciprocal of a(n) = asymptotic fraction of positive integers whose longest string of consecutive divisors is A181062(n).

Original entry on oeis.org

2, 3, 12, 15, 70, 840, 1260, 2772, 30030, 720720, 765765, 12932920, 243374040, 6692786100, 40156716600, 83181770100, 2406725881560, 144403552893600, 148414762696200, 5476504743489780, 224275908542914800
Offset: 1

Views

Author

Matthew Vandermast, Oct 07 2010

Keywords

Comments

The asymptotic average, as n increases, of n's longest string of consecutive divisors is the constant 1.787780456..., given in A064859.

Examples

			A number's longest string of consecutive divisors is a(5)=6 iff the integer is a multiple of 60 but not of 7. As n increases, the asymptotic fraction of positive integers satisfying those conditions equals 1/60 * 6/7 = 1/70. Therefore a(5) = 70.
		

Formula

a(n) = A051451(n) * A025473(n+1)/(A025473(n+1)-1).
If A181062(n) = 2^(e-1), then a(n) = A003418(2^e) = A051451(n+1).

A055874 a(n) = largest m such that 1, 2, ..., m divide n.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2
Offset: 1

Views

Author

Leroy Quet, Jul 16 2000

Keywords

Comments

From Antti Karttunen, Nov 20 2013 & Jan 26 2014: (Start)
Differs from A232098 for the first time at n=840, where a(840)=8, while A232098(840)=7. A232099 gives all the differing positions. See also the comments at A055926 and A232099.
The positions where a(n) is an odd prime is given by A017593 up to A017593(34)=414 (so far all 3's), after which comes the first 7 at a(420). (A017593 gives the positions of 3's.)
(Continued on Jan 26 2014):
Only terms of A181062 occur as values.
A235921 gives such n where a(n^2) (= A235918(n)) differs from A071222(n-1) (= A053669(n)-1). (End)
a(n) is the largest m such that A003418(m) divides n. - David W. Wilson, Nov 20 2014
a(n) is the largest number of consecutive integers dividing n. - David W. Wilson, Nov 20 2014
A051451 gives indices where record values occur. - Gionata Neri, Oct 17 2015
Yuri Matiyasevich calls this the maximum inheritable divisor of n. - N. J. A. Sloane, Dec 14 2023

Examples

			a(12) = 4 because 1, 2, 3, 4 divide 12, but 5 does not.
		

Crossrefs

Programs

  • Haskell
    a055874 n = length $ takeWhile ((== 0) . (mod n)) [1..]
    -- Reinhard Zumkeller, Feb 21 2012, Dec 09 2010
    
  • Maple
    N:= 1000: # to get a(1) to a(N)
    A:= Vector(N,1);
    for m from 2 do
      Lm:= ilcm($1..m);
      if Lm > N then break fi;
      if Lm mod (m+1) = 0 then next fi;
      for k from 1 to floor(N/Lm) do
        A[k*Lm]:=m
      od
    od:
    convert(A,list); # Robert Israel, Nov 28 2014
  • Mathematica
    a[n_] := Module[{m = 1}, While[Divisible[n, m++]]; m - 2]; Array[a, 100] (* Jean-François Alcover, Mar 07 2016 *)
  • PARI
    a(n) = my(m = 1); while ((n % m) == 0, m++); m - 1; \\ Michel Marcus, Jan 17 2014
    
  • Python
    from itertools import count
    def A055874(n):
        for m in count(1):
            if n % m:
                return m-1 # Chai Wah Wu, Jan 02 2022
  • Scheme
    (define (A055874 n) (let loop ((m 1)) (if (not (zero? (modulo n m))) (- m 1) (loop (+ 1 m))))) ;; Antti Karttunen, Nov 18 2013
    

Formula

a(n) = A007978(n) - 1. - Antti Karttunen, Jan 26 2014
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A064859 (Farhi, 2009). - Amiram Eldar, Jul 25 2022

A181063 Smallest positive integer with a discrete string of exactly n consecutive divisors, or 0 if no such integer exists.

Original entry on oeis.org

1, 2, 6, 12, 3960, 60, 420, 840, 17907120, 2520, 411863760, 27720, 68502634200, 447069823200, 360360, 720720, 7600186994400, 12252240, 9524356075634400, 81909462250455840, 1149071006394511200, 232792560, 35621201198229847200, 5354228880, 91351145008363640400
Offset: 1

Views

Author

Matthew Vandermast, Oct 07 2010

Keywords

Comments

The word "discrete" is used to describe a string of consecutive divisors that is not part of a longer such string.
Does a(n) ever equal 0?
a(n) = A003418(n) iff n belongs to A181062; otherwise, a(n) > A003418(n). a(A181062(n)) = A051451(n).

Examples

			a(5) = 3960 is divisible by 8, 9, 10, 11, and 12, but not 7 or 13. It is the smallest positive integer with a string of 5 consecutive divisors that is not part of a longer string.
From _Gus Wiseman_, Oct 16 2019: (Start)
The sequence of terms together with their divisors begins:
     1: {1}
     2: {1,2}
     6: {1,2,3,6}
    12: {1,2,3,4,6,12}
  3960: {1,2,...,8,9,10,11,12,...,1980,3960}
    60: {1,2,3,4,5,6,...,30,60}
   420: {1,2,3,4,5,6,7,...,210,420}
   840: {1,2,3,4,5,6,7,8,...,420,840}
(End)
		

Crossrefs

The version taking only the longest run is A328449.
The longest run of divisors of n has length A055874(n).
Numbers whose divisors > 1 have no non-singleton runs are A088725.
The number of successive pairs of divisors of n is A129308(n).

Programs

  • Mathematica
    tav=Table[Length/@Split[Divisors[n],#2==#1+1&],{n,10000}];
    Table[Position[tav,i][[1,1]],{i,Split[Union@@tav,#2==#1+1&][[1]]}] (* Assumes there are no zeros. - Gus Wiseman, Oct 16 2019 *)

A377782 First-differences of A031218(n) = greatest number <= n that is 1 or a prime-power.

Original entry on oeis.org

1, 1, 1, 1, 0, 2, 1, 1, 0, 2, 0, 2, 0, 0, 3, 1, 0, 2, 0, 0, 0, 4, 0, 2, 0, 2, 0, 2, 0, 2, 1, 0, 0, 0, 0, 5, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 3, 0, 0, 3, 0, 0, 0, 4, 0, 2, 0, 0, 0, 0, 0, 6, 0, 2, 0, 2, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Nov 16 2024

Keywords

Comments

Note 1 is a power of a prime (A000961) but not a prime-power (A246655).

Crossrefs

Positions of 1 are A006549.
Positions of 0 are A080765 = A024619 - 1, complement A181062 = A000961 - 1.
Positions of 2 are A120432 (except initial terms).
Sorted positions of first appearances appear to include A167236 - 1.
Positions of terms > 1 are A373677.
The restriction to primes minus 1 is A377289.
Below, A (B) indicates that A is the first-differences of B:
- This sequence is A377782 (A031218), which has restriction to primes A065514 (A377781).
- The opposite is A377780 (A000015), restriction A377703 (A345531).
- For nonsquarefree we have A378036 (A378033), opposite A378039 (A120327).
- For squarefree we have A378085 (A112925), restriction A378038 (A070321).
A000040 lists the primes, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A024619 lists the non-prime-powers, differences A375735, seconds A376599.
A361102 lists the non-powers of primes, differences A375708.
A378034 gives differences of A378032 (restriction of A378033).
Prime-powers between primes: A053607, A080101, A366833, A377057, A377286, A377287.

Programs

  • Mathematica
    Differences[Table[NestWhile[#-1&,n,#>1&&!PrimePowerQ[#]&],{n,100}]]

A070932 Possible number of units in a finite (commutative or non-commutative) ring.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 27, 28, 30, 31, 32, 36, 40, 42, 44, 45, 46, 48, 49, 52, 54, 56, 58, 60, 62, 63, 64, 66, 70, 72, 78, 80, 81, 82, 84, 88, 90, 92, 93, 96, 98, 100
Offset: 1

Views

Author

Sharon Sela (sharonsela(AT)hotmail.com), May 24 2002

Keywords

Comments

This is a list of the numbers of units in R where R ranges over all finite commutative or non-commutative rings.
By considering the ring Z_n and the finite fields GF(q) this sequence contains the values of the Euler function phi(n) (A000010) and prime powers - 1 (A181062). By taking direct product of rings, if n and m belong to the sequence then so does m*n.
Eric M. Rains has shown that these rules generate all terms of this sequence. More precisely, he shows this sequence (with 0 removed) is the multiplicative monoid generated by all numbers of the form q^n-q^{n-1} for n >= 1 and q a prime power (see Rains link).
Since the number of units of F_q[X]/(X^n) is q^n - q^(n-1), restricting to finite commutative rings gives the same sequence. A296241, which is a proper supersequence, allows the ring R to be infinite. - Jianing Song, Dec 24 2021

Crossrefs

A000252 is a subsequence.
A282572 is the subsequence of odd terms.
Proper subsequence of A296241.
The main entries concerned with the enumeration of rings are A027623, A037234, A037291, A037289, A038538, A186116.

Programs

  • Mathematica
    max = 100; A000010 = EulerPhi[ Range[2*max]] // Union // Select[#, # <= max &] &; A181062 = Select[ Range[max], Length[ FactorInteger[#]] == 1 &] - 1; FixedPoint[ Select[ Outer[ Times, #, # ] // Flatten // Union, # <= max &] &, Union[A000010, A181062] ] (* Jean-François Alcover, Sep 10 2013 *)
  • PARI
    list(lim)=my(P=1, q, v, u=List()); forprime(p=2, default(primelimit), if(eulerphi(P*=p)>=lim, q=p; break)); v=vecsort(vector(P/q*lim\eulerphi(P/q), k, eulerphi(k)), , 8); v=select(n->n<=lim, v); forprime(p=2, sqrtint(lim\1+1), P=p; while((P*=p) <= lim+1, listput(u, P-1))); v=vecsort(concat(v, Vec(u)), , 8); u=List([0]); while(#u, v=vecsort(concat(v, Vec(u)),,8); u=List(); for(i=3,#v, for(j=i,#v,P=v[i]*v[j]; if(P>lim,break); if(!vecsearch(v, P), listput(u, P))))); v \\ Charles R Greathouse IV, Jan 08 2013

Extensions

Entry revised by N. J. A. Sloane, Jan 06 2013, Jan 08 2013
Definition clarified by Jianing Song, Dec 24 2021

A181064 a(n) = first of exactly n consecutive integers that each divide A181063(n).

Original entry on oeis.org

1, 1, 1, 1, 8, 1, 1, 1, 14, 1, 14, 1, 18, 20, 1, 1, 20, 1, 24, 26, 32, 1, 30, 1, 33, 1, 32, 1, 32, 1, 1, 50, 38, 48, 38, 1, 42, 44, 42, 1, 48, 1, 54, 50, 62, 1, 50, 1, 54, 68, 62, 1, 74, 68, 72, 62, 74, 1, 62, 1, 90, 65, 1, 82, 72, 1, 72, 74, 80, 1, 80, 1, 84, 84, 82, 82, 80, 1, 84, 1, 110, 1, 90, 110, 108, 108, 104, 1, 102, 104
Offset: 1

Views

Author

Matthew Vandermast, Oct 07 2010

Keywords

Comments

a(n)=1 iff n belongs to A181062.
A181063(n) = lcm(a(n) .. a(n)+n-1).

Examples

			The discrete string of 5 consecutive integers that divide A181063(5)=3960 begins with 8 and ends with 12; hence a(5)=8.
		

Crossrefs

A249435 a(1) = 0, after which one less than prime powers p^m with exponent m >= 2.

Original entry on oeis.org

0, 3, 7, 8, 15, 24, 26, 31, 48, 63, 80, 120, 124, 127, 168, 242, 255, 288, 342, 360, 511, 528, 624, 728, 840, 960, 1023, 1330, 1368, 1680, 1848, 2047, 2186, 2196, 2208, 2400, 2808, 3124, 3480, 3720, 4095, 4488, 4912, 5040, 5328, 6240, 6560, 6858, 6888, 7920, 8191, 9408, 10200, 10608, 11448
Offset: 1

Views

Author

Antti Karttunen, Nov 02 2014

Keywords

Crossrefs

One less than A025475.
Subsequence of A181062 and also a subsequence of A249433 (after the initial zero).
Union of sequences A000225, A024023, A024049, A024075, A024127, etc. without their term a(1).
Apart from the first term, subsequence of A045542.

Programs

  • PARI
    list(lim)=my(v=List([0])); lim=lim\1+1; for(m=2,logint(lim,2), forprime(p=2,sqrtnint(lim,m), listput(v, p^m-1))); Set(v) \\ Charles R Greathouse IV, Aug 26 2015
  • Scheme
    (define (A249435 n) (- (A025475 n) 1))
    

Formula

a(n) = A025475(n) - 1.

A221178 Union of (prime powers minus 1) and values of Euler totient function.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 10, 12, 15, 16, 18, 20, 22, 24, 26, 28, 30, 31, 32, 36, 40, 42, 44, 46, 48, 52, 54, 56, 58, 60, 63, 64, 66, 70, 72, 78, 80, 82, 84, 88, 92, 96, 100, 102, 104, 106, 108, 110, 112, 116, 120, 124, 126, 127, 128, 130, 132, 136, 138, 140, 144, 148, 150, 156, 160, 162, 164, 166, 168, 172, 176
Offset: 1

Views

Author

Jean-François Alcover, Jan 06 2013

Keywords

Crossrefs

Cf. A000010, A002202, A000961, A181062, A070932 (multiplicative closure).

Programs

  • Mathematica
    max = 200;
    selNu = Select[Range[max], PrimeNu[#] == 1&]-1;
    phiQ[m_] := Select[Range[m+1, 2*m*Product[1/(1-1/(k*Log[k])), {k, 2, DivisorSigma[0, m]}]], EulerPhi[#] == m&, 1] != {};
    selPhi = Select[Range[max], phiQ];
    Join[{0}, Union[selNu, selPhi]]
  • PARI
    list(lim)=my(P=1, q, v, u=List([0])); forprime(p=2, default(primelimit), if(eulerphi(P*=p)>=lim, q=p; break)); v=vecsort(vector(P/q*lim\eulerphi(P/q), k, eulerphi(k)), , 8); v=select(n->n<=lim, v); forprime(p=2,sqrtint(lim\1+1),P=p;while((P*=p) <= lim+1, listput(u, P-1))); vecsort(concat(v, Vec(u)),,8) \\ Charles R Greathouse IV, Jan 08 2013

Formula

Union of A181062 and A002202.

Extensions

Edited by N. J. A. Sloane, Jan 06 2013

A276782 Where record values occur in A276781, when starting from A276781(2)=1.

Original entry on oeis.org

2, 6, 15, 22, 36, 58, 95, 96, 147, 148, 209, 210, 305, 306, 901, 902, 903, 904, 905, 906, 1149, 1150, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 5621, 5622, 8499, 8500, 9585, 9586, 15719, 15720, 15721, 15722, 15723, 15724, 15725, 15726, 19653, 19654, 19655, 19656, 19657, 19658, 19659, 19660, 31449
Offset: 1

Views

Author

N. J. A. Sloane, Sep 29 2016

Keywords

Comments

Terms at the end of each run, that is, terms k that are not followed by k+1 (i.e., this excludes terms like 95, 147, 209, 901 .. 905, 1149, ...) form a subsequence of A181062. - Antti Karttunen, Jan 20 2020

Crossrefs

Programs

  • Maple
    A276781 := proc(n)
        local b,k;
        for b from 0 to floor(n/2+1) do
            igcd(seq(binomial(n,k),k=b..n-b)) ;
            if % > 1 then
                return b ;
            end if;
        end do:
    end proc:
    am := -1 ;
    for n from 2 do
        an := A276781(n) ;
        if an > am then
            printf("%d,\n",n) ;
            am := an ;
        end if;
    end do: # R. J. Mathar, Sep 30 2016
  • Mathematica
    Function[t, First@ Position[t, #] & /@ Range@ Max@ t][{0}~Join~Table[b = 1; While[GCD @@ Map[Binomial[n, #] &, Range[b, n - b]] == 1, b++]; b, {n, 2, 1500}]] // Flatten (* Michael De Vlieger, Oct 03 2016 *)
  • PARI
    A276781(n) = if(1==n,1,forstep(k=n,1,-1,if(isprimepower(k),return(1+n-k))));
    m=0; k=0; n=1; while(k<210,n++; if((t=A276781(n))>m, m=t; k++; print1(n, ", "))); \\ Antti Karttunen, Jan 29 2020

Extensions

a(11)-a(30) from R. J. Mathar, Sep 30 2016
More terms from Chai Wah Wu, Oct 02 2016
Definition amended because of the changed definition of A276781, while keeping the terms same as before. - Antti Karttunen, Jan 29 2020

A367013 Let q be the n-th prime power (A246655), then a(n) = q - Kronecker(-4,q).

Original entry on oeis.org

2, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 20, 24, 24, 28, 28, 32, 32, 36, 40, 44, 48, 48, 52, 60, 60, 64, 68, 72, 72, 80, 80, 84, 88, 96, 100, 104, 108, 108, 112, 120, 124, 128, 128, 132, 136, 140, 148, 152, 156, 164, 168, 168, 172, 180, 180, 192, 192, 196, 200, 212, 224, 228, 228, 232
Offset: 1

Views

Author

Jianing Song, Nov 01 2023

Keywords

Comments

If q is odd, then a(n) is the number of solutions to x^2 + y^2 = t in the finite field F_q for any t != 0.
Proof: We first show that if x^2 + y^2 = t has a solution for t != 0, then the number of solutions is q - Kronecker(-4,q). Let (x_0,y_0) be a solution, then the other points on the circle x^2 + y^2 = t are parametrized by the lines through (x_0,y_0) with slope in F_q U {oo}. The line with slope k has an intersection with the circle other than (x_0,y_0) if and only if 1 + k^2 != 0 (in which case the intersection is the point at infinity) and k != -x_0/y_0 (in which case the line is tangent to the circle), so we have (q+1)-3 more solutions if q == 1 (mod 4) and (q+1)-1 more solutions if q == 3 (mod 4). By a simple counting argument we can see that x^2 + y^2 = t has a solution for all t != 0.

Examples

			For q = A246655(4) = 5, we see that in F_5:
 - x^2 + y^2 = 1 has 4 solutions (0,+-1), (+-1,0);
 - x^2 + y^2 = 2 has 4 solutions (+-1,+-1);
 - x^2 + y^2 = -2 has 4 solutions (+-2,+-2);
 - x^2 + y^2 = -1 has 4 solutions (+-2,0), (0,+-2),
so a(4) = 4.
For q = A246655(5) = 7, we see that in F_7:
 - x^2 + y^2 = 1 has 8 solutions (0,+-1), (+-1,0), (+-2,+-2);
 - x^2 + y^2 = 2 has 8 solutions (0,+-3), (+-3,0), (+-1,+-1);
 - x^2 + y^2 = 3 has 8 solutions (+-1,+-3), (+-3,+-1);
 - x^2 + y^2 = -3 has 8 solutions (+-2,0), (0,+-2), (+-3,+-3);
 - x^2 + y^2 = -2 has 8 solutions (+-1,+-2), (+-2,+-1);
 - x^2 + y^2 = -1 has 8 solutions (+-2,+-3), (+-3,+-2),
so a(5) = 8.
For q = A246655(7) = 9, we see that in F_9 = F_3(i):
 - x^2 + y^2 = 1 has 8 solutions (0,+-1), (+-1,0), (+-i,+-i);
 - x^2 + y^2 = -1 has 8 solutions (0,+-i), (+-i,0), (+-1,+-1);
 - x^2 + y^2 = 1+i has 8 solutions (+-1,+-(1-i)), (+-(1-i),+-1);
 - x^2 + y^2 = i has 8 solutions (0,+-(1-i)), (+-(1-i),0), (+-(1+i),+-(1+i));
 - x^2 + y^2 = -1+i has 8 solutions (+-i,+-(1-i)), (+-(1-i),+-i);
 - x^2 + y^2 = 1-i has 8 solutions (+-1,+-(1+i)), (+-(1+i),+-1);
 - x^2 + y^2 = -i has 8 solutions (0,+-(1+i)), (+-(1+i),0), (+-(1-i),+-(1-i));
 - x^2 + y^2 = -1-i has 8 solutions (+-i,+-(1+i)), (+-(1+i),+-i),
so a(7) = 8.
		

Crossrefs

Cf. A246655, A101455 ({kronecker(-4,n)}), A181062 (x*y or x^2-y^2 instead of x^2+y^2).

Programs

  • PARI
    lim_A367013(N) = for(n=2, N, if(isprimepower(n), print1(n - kronecker(-4, n), ", ")))
    
  • Python
    from sympy import primepi, integer_nthroot, kronecker_symbol
    def A367013(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        return (m:=bisection(f,n,n))-kronecker_symbol(-4,m) # Chai Wah Wu, Jan 19 2025
Showing 1-10 of 13 results. Next