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.

Previous Showing 11-20 of 53 results. Next

A070258 Smallest of 3 consecutive numbers each divisible by a square.

Original entry on oeis.org

48, 98, 124, 242, 243, 342, 350, 423, 475, 548, 603, 724, 774, 844, 845, 846, 1024, 1250, 1274, 1323, 1375, 1420, 1448, 1519, 1664, 1674, 1680, 1681, 1682, 1848, 1862, 1924, 2007, 2023, 2056, 2106, 2150, 2223, 2275, 2348, 2366, 2523, 2527, 2574, 2644
Offset: 1

Views

Author

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

Keywords

Comments

The sequence includes an infinite family of arithmetic progressions. Such AP's can be constructed to each term, with large differences [like e.g. square of primorials, A061742]. It is necessary to solve suitable systems of linear Diophantine equations. E.g.: subsequences of triples of terms = {900a+548, 900a+549, 900a+550} = {4(225f+137), 9(100f+61), 25(36f+22)}; starting terms in this sequence = {548, 1448, 2348, ...}; difference = A002110(3)^2. - Labos Elemer, Nov 25 2002
The numbers of terms not exceeding 10^k, for k = 1, 2, ..., are 0, 2, 16, 180, 1868, 18649, 186335, 1863390, 18634236, 186340191, ... . Apparently, the asymptotic density of this sequence exists and equals 0.01863... . - Amiram Eldar, Jan 18 2023
The asymptotic density of this sequence is 1 - 3/zeta(2) + 3 * Product_{p prime} (1 - 2/p^2) - Product_{p prime} (1 - 3/p^2) = 1 - 3 * A059956 + 3 * A065474 - A206256 = 0.018634010349844827414... . - Amiram Eldar, Sep 12 2024

References

  • Jean-Marie De Koninck, Ces nombres qui nous fascinent, Entry 48, p. 18, Ellipses, Paris, 2008.

Crossrefs

Subsequence of A013929 and A068781.

Programs

  • Mathematica
    f[n_] := Union[ Transpose[ FactorInteger[n]] [[2]]] [[ -1]]; a = 0; b = 1; Do[c = f[n]; If[a> 1 && b > 1 && c > 1, Print[n - 2]]; a = b; b = c, {n, 3, 10^6}]
    Flatten[Position[Partition[SquareFreeQ/@Range[3000],3,1],?(Union[#] == {False}&),{1},Heads->False]] (* _Harvey P. Dale, May 24 2014 *)
    f@n_ := Flatten@  Position[Partition[SquareFreeQ /@ Range@2000, n, 1], Table[False, {n}]]; f@3 (* Hans Rudolf Widmer, Aug 30 2022 *)

Formula

a(n) = A235578(n) - 1. - Amiram Eldar, Feb 09 2021

Extensions

More terms from Jason Earls and Robert G. Wilson v, May 10 2002
Offset corrected by Amiram Eldar, Feb 09 2021

A206256 Decimal expansion of Product_{p prime} (1 - 3/p^2).

Original entry on oeis.org

1, 2, 5, 4, 8, 6, 9, 8, 0, 9, 0, 5, 8, 0, 9, 2, 9, 8, 3, 3, 4, 4, 2, 7, 9, 9, 9, 0, 8, 9, 7, 5, 3, 5, 4, 0, 5, 7, 1, 9, 8, 4, 6, 8, 7, 2, 7, 8, 9, 2, 2, 8, 4, 6, 9, 4, 2, 2, 0, 4, 9, 6, 1, 0, 7, 4, 4, 0, 1, 0, 1, 9, 6, 1, 7, 1, 5, 4, 5, 8, 3, 7, 5, 4, 9, 1, 1, 1, 2, 2, 7, 1, 5, 7, 2, 8, 8, 3, 9, 9, 1, 7, 4, 7, 4, 6
Offset: 0

Views

Author

N. J. A. Sloane, Feb 05 2012, based on a posting by Warren Smith to the Math Fun Mailing List, Feb 04 2012

Keywords

Comments

For a randomly selected number k, this is the probability that k, k+1, k+2 all are squarefree.

Examples

			0.1254869809058...
		

Crossrefs

Programs

  • Maple
    # See A175640 using efact := 1-3/p^2. - R. J. Mathar, Mar 22 2012
  • Mathematica
    $MaxExtraPrecision = 500; m = 500; c = LinearRecurrence[{0, 3}, {0, -6}, m]; RealDigits[(1/4) * Exp[NSum[Indexed[c, n]*(PrimeZetaP[n] - 1/2^n)/n, {n, 2, m}, NSumTerms -> m, WorkingPrecision -> m]], 10, 100][[1]] (* Amiram Eldar, Oct 01 2019 *)
  • PARI
    prodeulerrat(1 - 3/p^2) \\ Amiram Eldar, Mar 16 2021

Extensions

More terms from Amiram Eldar, Oct 01 2019
More terms from Vaclav Kotesovec, Dec 17 2019

A280892 Squareful numbers with both neighbors squarefree.

Original entry on oeis.org

4, 12, 16, 18, 20, 32, 36, 40, 52, 54, 56, 60, 68, 72, 84, 88, 90, 92, 96, 104, 108, 112, 128, 132, 140, 144, 150, 156, 160, 162, 164, 180, 184, 192, 196, 198, 200, 204, 212, 216, 220, 228, 232, 234, 236, 240, 248, 250, 252, 256, 264, 268, 270, 272, 284, 292, 294, 300, 304, 306, 308, 312
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 16 2017

Keywords

Comments

Subsequence of A013929 and A067874.
The asymptotic density of this sequence is Product_{p prime} (1 - 2/p^2) - Product_{p prime} (1 - 3/p^2) = 0.197147118033435... (Mossinghoff et al., 2021). - Amiram Eldar, Nov 11 2021, Mar 21 2024

Examples

			4 is in this sequence because 4 = 2^2 is nonsquarefree and both 4 - 1 = 3 and 4 + 1 = 5 are squarefree.
		

Crossrefs

Programs

  • Magma
    [n: n in [2..300] | not IsSquarefree(n) and IsSquarefree(n-1) and IsSquarefree(n+1)];
    
  • Mathematica
    Mean/@SequencePosition[Table[If[SquareFreeQ[n],1,0],{n,400}],{1,0,1}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 19 2020 *)
  • PARI
    isok(n) = !issquarefree(n) && issquarefree(n-1) && issquarefree(n+1); \\ Michel Marcus, Jun 18 2017

Extensions

Definition corrected by Jon E. Schoenfield, Jun 18 2017

A067874 Positive integers x satisfying x^2 - D*y^2 = 1 for a unique integer D.

Original entry on oeis.org

2, 4, 6, 12, 14, 16, 18, 20, 22, 30, 32, 34, 36, 38, 40, 42, 52, 54, 56, 58, 60, 66, 68, 70, 72, 78, 84, 86, 88, 90, 92, 94, 96, 102, 104, 106, 108, 110, 112, 114, 128, 130, 132, 138, 140, 142, 144, 150, 156, 158, 160, 162, 164, 166, 178, 180, 182, 184, 186, 192, 194, 196, 198
Offset: 1

Views

Author

Lekraj Beedassy, Feb 25 2002

Keywords

Comments

D is unique iff x^2 - 1 is squarefree, in which case it follows with necessity that D=x^2-1 and y=1.
All terms are even. A014574 is a subsequence.
Conjecture: All terms of A002110 > 1 are a subsequence. - Griffin N. Macris, Apr 11 2016
All n such that n+1 and n-1 are in A056911. - Robert Israel, Apr 12 2016
The asymptotic density of this sequence is Product_{p prime} (1 - 2/p^2) = 0.322634... (A065474). - Amiram Eldar, Feb 25 2021

Crossrefs

Cf. A002110, A005117, A014574, A056911, A065474, A226993, A272799, A280892, A379971 (characteristic function).
Subsequence of A379965.

Programs

  • Magma
    [n: n in [1..110] | IsSquarefree(n-1) and IsSquarefree(n+1)]; // Juri-Stepan Gerasimov, Jan 17 2017
    
  • Maple
    select(t -> numtheory:-issqrfree(t^2-1), [seq(n,n=2..1000,2)]); # Robert Israel, Apr 12 2016
  • Mathematica
    Select[Range[200], SquareFreeQ[#^2-1]&] (* Vladimir Joseph Stephan Orlovsky, Oct 26 2009 *)
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A067874_gen(startvalue=2): # generator of terms >= startvalue
        return filter(lambda k:max(factorint(k-1).values(),default=1)==1 and max(factorint(k+1).values())==1, count(max(startvalue+(startvalue&1),2),2))
    A067874_list = list(islice(A067874_gen(),20)) # Chai Wah Wu, Apr 24 2024

Formula

a(n) = 2*A272799(n). - Juri-Stepan Gerasimov, Jan 17 2017

Extensions

Corrected and extended by Max Alekseyev, Apr 26 2009
Further edited by Max Alekseyev, Apr 28 2009

A083542 a(n) = phi(n+1)*phi(n), product of totients of two consecutive integers.

Original entry on oeis.org

1, 2, 4, 8, 8, 12, 24, 24, 24, 40, 40, 48, 72, 48, 64, 128, 96, 108, 144, 96, 120, 220, 176, 160, 240, 216, 216, 336, 224, 240, 480, 320, 320, 384, 288, 432, 648, 432, 384, 640, 480, 504, 840, 480, 528, 1012, 736, 672, 840, 640, 768, 1248, 936, 720, 960, 864, 1008
Offset: 1

Views

Author

Labos Elemer, May 21 2003

Keywords

Crossrefs

Programs

  • Haskell
    a083542 n = a000010 n * a000010 (n + 1)
    a083542_list = zipWith (*) (tail a000010_list) a000010_list
    -- Reinhard Zumkeller, Apr 22 2012
    
  • Maple
    a:= n-> (p-> p(n)*p(n+1))(numtheory[phi]):
    seq(a(n), n=1..60);  # Alois P. Heinz, Jan 21 2022
  • Mathematica
    Times @@ EulerPhi@ # & /@ Partition[Range@ 58, 2, 1] (* Michael De Vlieger, Mar 25 2017 *)
    Times@@@Partition[EulerPhi[Range[60]],2,1] (* Harvey P. Dale, Oct 29 2019 *)
  • PARI
    a(n) = eulerphi(n) * eulerphi(n+1); \\ Amiram Eldar, Jul 10 2024

Formula

a(n) = A000010(A002378(n)). - Amiram Eldar, Jul 10 2024
Sum_{k=1..n} a(k) = c * n^3 / 3 + O((n*log(n))^2), where c = Product_{p prime} (1 - 2/p^2) = 0.322634... (A065474). - Amiram Eldar, Dec 09 2024
a(n) = A058515(n)*A066813(n). - Amiram Eldar, May 07 2025

A057475 Number of k, 1 <= k <= n, such that gcd(n,k) = gcd(n+1,k) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 3, 2, 4, 3, 4, 5, 3, 4, 8, 5, 6, 7, 5, 5, 10, 7, 7, 9, 8, 8, 12, 7, 8, 15, 10, 9, 11, 8, 12, 17, 11, 9, 16, 11, 12, 19, 11, 11, 22, 15, 14, 17, 13, 15, 24, 17, 14, 17, 15, 17, 28, 15, 16, 29, 17, 18, 24, 15, 20, 31, 21, 15, 24, 23, 24, 35, 19, 19, 28, 18, 24, 31, 22
Offset: 1

Views

Author

Leroy Quet, Sep 27 2000

Keywords

Comments

Number of numbers between 1 and n-1 coprime to n(n+1).
It is conjectured that every positive integer appears. - Jon Perry, Dec 12 2002

Examples

			a(8) = 3 because 1, 5 and 7 are all relatively prime to both 8 and 9.
a(9) counts those numbers coprime to 90, i.e., 1 and 7, hence a(9) = 2.
		

Crossrefs

Programs

  • Magma
    [#[k:k in [1..n]| Gcd(n,k) eq Gcd(n+1,k) and Gcd(n,k) eq 1]: n in [1..80]]; // Marius A. Burtea, Oct 15 2019
  • Maple
    A057475 := proc(n)
        local a,k ;
        a :=  0;
        for k from 1 to n do
            if igcd(k,n) = 1 and igcd(k,n+1)=1 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A057475(n),n=1..80) ; # R. J. Mathar, May 13 2025
  • Mathematica
    a[ n_ ] := Length @ Select[ Range[ n ], GCD[ n, # ] == GCD[ n + 1, # ] == 1 & ]; Table[ a[ n ], {n, 80} ] (* Ray Chandler, Dec 06 2006 *)
  • PARI
    newphi(v)=local(vl,fl,np); vl=length(v); np=0; for (s=1,v[1],fl=false; for (r=1,vl,if (gcd(s,v[r])>1,fl=true; break)); if (fl==false,np++)); np
    v=vector(2); for (i=1,500,v[1]=i; v[2]=i+1; print1(newphi(v)","))
    

Formula

From Reinhard Zumkeller, May 02 2006: (Start)
a(A000040(n)-1) = A000010(A000040(n)-1);
a(A000040(n)) = A000010(A000040(n)+1)-1;
a(A118854(n)-1) = a(A118854(n)). (End)
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{p prime} (1 - 2/p^2) = 0.322634... (A065474). - Amiram Eldar, Dec 10 2024
a(n) = A057828(A002378(n)). - Ridouane Oudra, May 30 2025

A065469 Decimal expansion of Product_{p prime} (1 - 1/(p^2-1)).

Original entry on oeis.org

5, 3, 0, 7, 1, 1, 8, 2, 0, 4, 7, 2, 0, 4, 4, 7, 9, 4, 9, 7, 2, 9, 4, 3, 7, 7, 2, 4, 7, 2, 9, 7, 7, 1, 7, 0, 9, 4, 7, 8, 6, 1, 0, 2, 2, 2, 0, 9, 8, 6, 0, 4, 0, 3, 4, 7, 5, 8, 1, 9, 0, 4, 9, 2, 8, 0, 9, 0, 5, 0, 6, 7, 9, 2, 6, 0, 9, 5, 7, 9, 0, 6, 3, 8, 6, 3, 8, 1, 9, 2, 4, 5, 6, 3, 6, 2, 3, 5
Offset: 0

Views

Author

N. J. A. Sloane, Nov 19 2001

Keywords

Examples

			0.53071182047204479497294377247...
		

Crossrefs

Programs

  • Mathematica
    $MaxExtraPrecision = 800; digits = 98; terms = 800; P[n_] := PrimeZetaP[n]; LR = LinearRecurrence[{0, 3, 0, -2}, {0, 0, -2, 0}, terms + 10]; r[n_Integer] := LR[[n]]; Exp[NSum[r[n]*P[n - 1]/(n - 1), {n, 3, terms}, NSumTerms -> terms, WorkingPrecision -> digits + 10]] // RealDigits[#, 10, digits]& // First (* Jean-François Alcover, Apr 18 2016 *)
  • PARI
    prodeulerrat(1 - 1/(p^2-1)) \\ Amiram Eldar, Mar 13 2021

Formula

Product of A013661 by A065474. - R. J. Mathar, Mar 26 2011
From Amiram Eldar, Jan 14 2022: (Start)
Equals Sum_{k>=1} mu(k)/(phi(k)*sigma(k)), where mu is the Möbius function (A008683), phi is the Euler totient function (A000010) and sigma(k) is the sum of divisors of k (A000203).
Equals Sum_{k>=1} mu(k)/J_2(k), where J_2 is Jordan's totient function (A007434). (End)

A281192 Numbers with no squarefree neighbors.

Original entry on oeis.org

17, 19, 26, 49, 51, 53, 55, 89, 91, 97, 99, 125, 127, 149, 151, 161, 163, 170, 197, 199, 233, 235, 241, 243, 244, 249, 251, 269, 271, 293, 295, 305, 307, 337, 339, 341, 343, 349, 351, 362, 377, 379, 413, 415, 424, 449, 451, 476, 485, 487, 489, 491, 521, 523, 530, 549, 551, 557, 559, 577
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 16 2017

Keywords

Comments

Includes all k == 17 or 19 (mod 36), also 2*p^2-1 and 2*p^2+1 for odd primes p. - Robert Israel, Jan 17 2017
This sequence has density around 0.106.... - Charles R Greathouse IV, Jan 23 2017
More accurately, the asymptotic density of this sequence is 1 - 2/zeta(2) + Product_{p prime} (1 - 2/p^2) = 1 - 2 * A059956 + A065474 = 0.1067798952... - Amiram Eldar, Feb 25 2021

Examples

			17 is in this sequence because 17 - 1 = 16 = 2^4 and 17 + 1 = 18 = 2*3^2 are not squarefree.
		

Crossrefs

Supersequence of A075432 and A235578.

Programs

  • Magma
    [n: n in [2..600] | not IsSquarefree(n-1) and not IsSquarefree(n+1)];
    
  • Maple
    select(t -> not numtheory:-issqrfree(t-1) and not numtheory:-issqrfree(t+1), [$1..1000]); # Robert Israel, Jan 17 2017
  • Mathematica
    Select[Range[600], !SquareFreeQ[# - 1] && !SquareFreeQ[# + 1] &] (* Vincenzo Librandi, Jan 17 2017 *)
  • PARI
    is(n)=!issquarefree(n-1) && !issquarefree(n+1) \\ Charles R Greathouse IV, Jan 23 2017

A002472 Number of pairs x,y such that y-x=2, (x,n)=1, (y,n)=1 and 1 <= x <= n.

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 5, 4, 3, 3, 9, 2, 11, 5, 3, 8, 15, 3, 17, 6, 5, 9, 21, 4, 15, 11, 9, 10, 27, 3, 29, 16, 9, 15, 15, 6, 35, 17, 11, 12, 39, 5, 41, 18, 9, 21, 45, 8, 35, 15, 15, 22, 51, 9, 27, 20, 17, 27, 57, 6, 59, 29, 15, 32, 33, 9, 65, 30, 21, 15, 69, 12, 71, 35, 15, 34, 45, 11, 77, 24, 27
Offset: 1

Views

Author

Keywords

Comments

This is the function phi(n, 2) defined in Alder. - Michel Marcus, Nov 14 2017

Examples

			For n = 4, the condition gcd(x,4) = gcd(x+2,4) = 1 is satisfied by exactly two positive integers x not exceeding n, namely, by x = 1 and x = 3. Therefore a(4) = 2.
		

References

  • V. A. Golubev, Sur certaines fonctions multiplicatives et le problème des jumeaux. Mathesis 67 (1958), 11-20.
  • V. A. Golubev, Nombres de Mersenne et caractères du nombre 2. Mathesis 67 (1958), 257-262.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000010 (phi(n,0)), A058026 (phi(n,1)), A065474.
Similar generalizations of Euler's totient for prime k-tuples: this sequence (k=2), A319534 (k=3), A319516 (k=4), A321029 (k=5), A321030 (k=6).

Programs

  • Haskell
    a002472 n = length [x | x <- [1..n], gcd n x == 1, gcd n (x + 2) == 1]
    -- Reinhard Zumkeller, Mar 23 2012
  • Maple
    with(numtheory): seq(add(mobius(d)*phi(2*n)/phi(2*d), d in divisors(n)), n=1..100); # Ridouane Oudra, Aug 20 2024
  • Mathematica
    a[n_] := If[ Head[ r=Reduce[ GCD[x, n] == 1 && GCD[x+2, n] == 1 && 1 <= x <= n, x, Integers]] === Or, Length[r], 1]; Table[a[n], {n, 1, 81}] (* Jean-François Alcover, Nov 22 2011 *)
    (* Second program (5 times faster): *)
    a[n_] := Sum[Boole[GCD[n, x] == 1 && GCD[n, x+2] == 1], {x, 1, n}];
    Array[a, 81] (* Jean-François Alcover, Jun 19 2018, after Michel Marcus *)
    f[p_, e_] := If[p == 2, p^(e-1), (p-2)*p^(e-1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 22 2020 *)
  • PARI
    a(n)=my(k=valuation(n,2),f=factor(n>>k));prod(i=1,#f[,1],(f[i,1]-2)*f[i,1]^(f[i,2]-1))<Charles R Greathouse IV, Nov 22 2011
    
  • PARI
    a(n) = sum(x=1, n, (gcd(n,x) == 1) && (gcd(n, x+2) == 1)); \\ Michel Marcus, Nov 14 2017
    

Formula

Multiplicative with a(p^e) = p^(e-1) if p = 2; (p-2)*p^(e-1) if p > 2. - David W. Wilson, Aug 01 2001
a(n) = Sum_{k=1..n} [GCD(2*n-k,n) * GCD(k+2,n) = 1], where [ ] is the Iverson bracket. - Wesley Ivan Hurt, Sep 29 2021
Sum_{k=1..n} a(k) ~ c * n^2, where c = (3/4) * Product_{p prime} (1 - 2/p^2) = (3/4) * A065474 = 0.2419755742... . - Amiram Eldar, Oct 23 2022
From Ridouane Oudra, Aug 20 2024: (Start)
a(n) = phi(2*n) * Sum_{d|n} mu(d)/phi(2*d).
a(n) = - phi(n) * Sum_{d|n} mu(2*d)/phi(d).
a(n) = A160467(n)*A058026(A000265(n)).
a(2*n+1) = A070554(n).
a(2^m*(2*n+1)) = 2^(m-1)*A070554(n), with m>0. (End)

Extensions

More terms from David W. Wilson

A065093 Convolution of A000010 with itself.

Original entry on oeis.org

1, 2, 5, 8, 16, 20, 36, 44, 68, 76, 120, 124, 188, 196, 276, 272, 404, 380, 544, 532, 716, 668, 968, 860, 1184, 1120, 1472, 1332, 1896, 1624, 2204, 2036, 2656, 2352, 3284, 2752, 3684, 3356, 4324, 3744, 5192, 4312, 5720, 5180, 6540, 5628, 7768, 6388, 8476
Offset: 1

Views

Author

Vladeta Jovovic, Nov 11 2001

Keywords

Crossrefs

Column k=2 of A340995.

Programs

  • Mathematica
    Table[Sum[EulerPhi[j]*EulerPhi[n-j], {j, 1, n-1}], {n, 2, 50}] (* Vaclav Kotesovec, Aug 18 2021 *)
  • PARI
    { for (n=1, 1000, a=sum(k=1, n, eulerphi(k)*eulerphi(n+1-k)); write("b065093.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 06 2009

Formula

a(n) = Sum_{k=1..n} phi(k)*phi(n+1-k), where phi is Euler totient function (A000010).
G.f.: (1/x)*(Sum_{k>=1} mu(k)*x^k/(1 - x^k)^2)^2. - Ilya Gutkovskiy, Jan 31 2017
a(n) ~ (n^3/6) * c * Product_{primes p|n+1} ((p^3-2*p+1)/(p*(p^2-2))), where c = Product_{p prime} (1 - 2/p^2) = 0.322634... (A065474) (Ingham, 1927). - Amiram Eldar, Jul 13 2024
Previous Showing 11-20 of 53 results. Next