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 21-30 of 32 results. Next

A348953 a(n) = -Sum_{d|n, d < sqrt(n)} (-1)^(d + n/d) * d.

Original entry on oeis.org

0, 1, -1, 1, -1, 3, -1, -1, -1, 3, -1, 2, -1, 3, -4, -1, -1, 6, -1, 3, -4, 3, -1, -2, -1, 3, -4, 3, -1, 11, -1, -5, -4, 3, -6, 6, -1, 3, -4, 0, -1, 12, -1, 3, -9, 3, -1, -8, -1, 8, -4, 3, -1, 12, -6, 2, -4, 3, -1, 5, -1, 3, -11, -5, -6, 12, -1, 3, -4, 15, -1, 0, -1, 3, -9, 3, -8, 12, -1, -8
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 04 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[-DivisorSum[n, (-1)^(# + n/#) # &, # < Sqrt[n] &], {n, 1, 80}]
    nmax = 80; CoefficientList[Series[Sum[k x^(k (k + 1))/(1 + x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
  • PARI
    A348953(n) = -sumdiv(n,d,if((d*d)Antti Karttunen, Nov 05 2021

Formula

G.f.: Sum_{k>=1} k * x^(k*(k + 1)) / (1 + x^k).
a(n) = A037213(n) - A348608(n). - Ridouane Oudra, Aug 21 2025

A062320 Nonsquarefree numbers squared. A013929(n)^2.

Original entry on oeis.org

16, 64, 81, 144, 256, 324, 400, 576, 625, 729, 784, 1024, 1296, 1600, 1936, 2025, 2304, 2401, 2500, 2704, 2916, 3136, 3600, 3969, 4096, 4624, 5184, 5625, 5776, 6400, 6561, 7056, 7744, 8100, 8464, 9216, 9604, 9801, 10000, 10816, 11664, 12544, 13456
Offset: 1

Views

Author

Jason Earls, Jul 05 2001

Keywords

Comments

A008966(A037213(a(n))) = 0. - Reinhard Zumkeller, Sep 03 2015

Crossrefs

Squares in A046099.

Programs

  • Haskell
    a062320 = (^ 2) . a013929 -- Reinhard Zumkeller, Sep 03 2015
    
  • PARI
    for(n=1,55, if(issquarefree(n), n+1,print(n^2)))
    
  • PARI
    n=-1; for (m=1, 10^9, if (!issquarefree(m), write("b062320.txt", n++, " ", m^2); if (n==1000, break))) \\ Harry J. Smith, Aug 04 2009
    
  • PARI
    is(n)=issquare(n,&n) && !issquarefree(n) \\ Charles R Greathouse IV, Sep 18 2015
    
  • Python
    from math import isqrt
    from sympy import mobius
    def A062320(n):
        def f(x): return n+1+sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
        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
        return bisection(f)**2 # Chai Wah Wu, Aug 31 2024

Formula

Sum_{n>=1} 1/a(n) = Pi^2/6 - 15/Pi^2. - Amiram Eldar, Jul 16 2020

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jul 11 2001
Offset corrected by Andrew Howroyd, Sep 18 2024

A173517 a(n) = k if n is the k-th nonsquare, zero otherwise.

Original entry on oeis.org

0, 0, 1, 2, 0, 3, 4, 5, 6, 0, 7, 8, 9, 10, 11, 12, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 0, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 20 2010

Keywords

Comments

a(A000037(n)) = n; a(A000290(n)) = 0.
a(n)*A037213(n) = 0 for all n.

Crossrefs

Programs

Formula

a(n) = (1 - A010052(n))*A028391(n).

Extensions

Definition revised by Reinhard Zumkeller, Dec 15 2013, at the suggestion of Antti Karttunen, who further edited the name

A076948 Smallest k such that nk-1 is a square, or 0 if no such number exists.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 5, 0, 0, 0, 0, 5, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 0, 0, 0, 0, 5, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 10, 13, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Amarnath Murthy, Oct 20 2002

Keywords

Crossrefs

Cf. A008784.
Cf. A037213.

Programs

  • Haskell
    a076948 1 = 1
    a076948 n = if null qs then 0 else head qs
                where qs = filter ((> 0) . a037213 . subtract 1 . (* n)) [1..n]
    -- Reinhard Zumkeller, Oct 25 2015
    
  • Mathematica
    a[n_] := Module[{r, j, k}, r = Solve[j>0 && k>0 && n k - 1 == j^2, {j, k}, Integers]; If[r === {}, Return[0], Return[k /. (r /. C[1] -> 0) // Min]]]; a[1] = 1;
    Array[a, 100] (* Jean-François Alcover, Apr 27 2020 *)
  • PARI
    a(n) = if (!issquare(Mod(-1, n)), 0, my(k=1); while (!issquare(n*k-1), k++); k); \\ Michel Marcus, Apr 27 2020

Formula

a(n) != 0 if and only if n is a term of A008784. - Joerg Arndt, Apr 27 2020
a(n) = 1 if and only if n is a term of A002522. - Bernard Schott, Apr 27 2020

Extensions

Edited and extended by Robert G. Wilson v, Oct 21 2002

A318460 a(n) = Sum_{d|n, d < n/d} (d XOR n/d), where XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 3, 2, 5, 4, 8, 6, 15, 8, 18, 10, 24, 12, 20, 20, 27, 16, 35, 18, 30, 24, 32, 22, 52, 24, 42, 36, 44, 28, 56, 30, 63, 40, 54, 36, 81, 36, 56, 52, 90, 40, 80, 42, 80, 68, 68, 46, 116, 48, 93, 68, 86, 52, 112, 68, 112, 72, 90, 58, 144, 60, 92, 98, 119, 72, 136, 66, 122, 88, 128, 70, 171, 72, 114, 110, 136, 88, 152, 78
Offset: 1

Views

Author

Antti Karttunen, Aug 28 2018

Keywords

Crossrefs

Programs

  • PARI
    A318460(n) = { my(xors=0); fordiv(n,d, if(d<(n/d), xors += bitxor(d,n/d))); (xors); };

Formula

a(n) = (1/2) * Sum_{d|n} (d XOR n/d).
a(n) = A318462(n) - A037213(n).

A347176 G.f.: Sum_{k>=1} (-1)^(k+1) * k * x^(k^2) / (1 - x^(k^2)).

Original entry on oeis.org

1, 1, 1, -1, 1, 1, 1, -1, 4, 1, 1, -1, 1, 1, 1, -5, 1, 4, 1, -1, 1, 1, 1, -1, 6, 1, 4, -1, 1, 1, 1, -5, 1, 1, 1, -4, 1, 1, 1, -1, 1, 1, 1, -1, 4, 1, 1, -5, 8, 6, 1, -1, 1, 4, 1, -1, 1, 1, 1, -1, 1, 1, 4, -13, 1, 1, 1, -1, 1, 1, 1, -4, 1, 1, 6, -1, 1, 1, 1, -5, 13, 1, 1, -1, 1, 1, 1, -1, 1, 4
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 21 2021

Keywords

Comments

Excess of sum of square roots of odd square divisors of n over sum of square roots of even square divisors of n.

Crossrefs

Programs

  • Mathematica
    nmax = 90; CoefficientList[Series[Sum[(-1)^(k + 1) k x^(k^2)/(1 - x^(k^2)), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[DivisorSum[n, (-1)^(# + 1) #^(1/2) &, IntegerQ[#^(1/2)] &], {n, 1, 90}]
    f[p_, e_] := (p^(Floor[e/2] + 1) - 1)/(p - 1); f[2, e_] := 3 - 2^(Floor[e/2] + 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 15 2022 *)
  • PARI
    a(n) = sumdiv(n, d, if (issquare(d), (-1)^((d%2)+1)*sqrtint(d))); \\ Michel Marcus, Aug 22 2021
    
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,1]==2, 3 - 2^(floor(f[i,2]/2) + 1), (f[i,1]^(floor(f[i,2]/2) + 1) - 1)/(f[i,1] - 1)));} \\ Amiram Eldar, Nov 15 2022

Formula

Multiplicative with a(2^e) = 3 - 2^(floor(e/2) + 1), and a(p^e) = (p^(floor(e/2) + 1) - 1)/(p - 1) for p > 2. - Amiram Eldar, Nov 15 2022
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = log(2) (A002162). - Amiram Eldar, Mar 01 2023

A320471 a(n) = floor(sqrt(n)) mod ceiling(sqrt(n)).

Original entry on oeis.org

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

Views

Author

Kritsada Moomuang, Oct 13 2018

Keywords

Comments

Sequence consists of zeros interleaved with the positive integers, each positive integer k appearing 2k times.

Crossrefs

Programs

  • Magma
    [Binomial(Ceiling(Sqrt(n)), Floor(Sqrt(n))) - 1: n in [1..100]]; // Vincenzo Librandi, Dec 02 2018
    
  • Maple
    a:= proc(n) modp(floor(sqrt(n)),ceil(sqrt(n))) end: seq(a(n),n=1..100); # Muniru A Asiru, Oct 17 2018
  • Mathematica
    Array[Mod[Floor@ #, Ceiling@ #] &@ Sqrt@ # &, 99] (* or *)
    Array[IntegerPart@ # - If[IntegerQ@ #, #, 0] &@ Sqrt@ # &, 99] (* or *)
    Flatten@ Array[{0}~Join~ConstantArray[#, 2 #] &, 9] (* Michael De Vlieger, Oct 15 2018 *)
  • PARI
    a(n) = sqrtint(n) % (1+sqrtint(n-1)); \\ Michel Marcus, Nov 04 2018
    
  • PARI
    a(n) = sqrtint(n-1) * !issquare(n) \\ David A. Corneth, Nov 04 2018
    
  • Python
    from math import isqrt
    def A320471(n): return 0 if (m:=isqrt(n))**2==n else m # Chai Wah Wu, Jul 29 2022

Formula

a(n) = A000196(n) - A037213(n).
a(n) = A000196(n)*A049240(n).
a(n) = A000196(n) mod A003059(n).
a(n) = (n - A173517(n)) - A037213(n)^2.
a(n) = binomial(ceiling(sqrt(n)),floor(sqrt(n))) - 1.
From David A. Corneth, Nov 04 2018: (Start)
a(k^2) = 0.
a(m) = floor(sqrt(m)) for nonsquare m. (End)

Extensions

Corrected by Michel Marcus, Jun 14 2022

A056926 a(n) = sqrt(n) if n is a square, otherwise 1.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jul 12 2000

Keywords

Comments

Like A037213, but has 1's instead of 0's for nonsquare n > 0. - Antti Karttunen, Jul 22 2018

Examples

			a(24) = 1 because 24 is not a square, a(25) = 5 because 25 = 5^2.
		

Crossrefs

Programs

  • Mathematica
    sq1[n_]:=Module[{sn=Sqrt[n]},If[IntegerQ[sn],sn,1]]; Array[sq1,110] (* Harvey P. Dale, Jul 25 2011 *)
  • PARI
    A056926(n) = if(issquare(n,&n),n,1); \\ Antti Karttunen, Jul 22 2018

Formula

a(n) = A007955(n)/A056925(n) = 1 + (sqrt(n)-1)*A010052(n), for all n >= 1.
a(n) = n^((d(n) mod 2)/2) for n>=1. - Wesley Ivan Hurt, Jun 07 2023

Extensions

Term a(0) = 0 prepended by Antti Karttunen, Jul 22 2018

A108655 Primes that are sums of the squares of two semiprimes.

Original entry on oeis.org

97, 181, 241, 277, 421, 457, 541, 641, 661, 709, 757, 821, 1109, 1117, 1237, 1301, 1381, 1597, 1621, 1669, 1709, 1901, 2069, 2341, 2381, 2417, 2437, 2557, 2617, 2677, 2741, 2797, 3041, 3061, 3221, 3557, 3637, 3701, 3733, 3989, 4241, 4261, 4421, 4517
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 07 2005

Keywords

Comments

Subsequence of A002144.
a(n) = A074985(i) + A074985(j) for appropriate i and j.

Examples

			A000040(733) = 5557 = 81 + 5476 = (3*3)^2 + (2*37)^2 =
A001358(3)^2 + A001358(25)^2 = A074985(3) + A074985(25),
therefore 5557 is a term.
		

Crossrefs

Programs

  • Haskell
    a108655 n = a108655_list !! (n-1)
    a108655_list = filter f a000040_list where
       f p = any (> 0) $ map (a064911 . a037213 . (p -)) $
                             takeWhile (< p) a074985_list
    -- Reinhard Zumkeller, Aug 09 2012

A156689 Inradii of primitive Pythagorean triples a^2+b^2=c^2, 0A020884).

Original entry on oeis.org

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

Views

Author

Ant King, Feb 18 2009

Keywords

Comments

The inradius is given by r=1/2 (a+b-c)=ab/(a+b+c)=area/semiperimeter, and the inradii ordered by increasing r are in A020888.

Examples

			The eighth primitive Pythagorean triple ordered by increasing a is (13,84,85). As this has inradius 1/2 (13+84-85)=6, we have a(8)=6.
		

References

  • Mohammad K. Azarian, Circumradius and Inradius, Problem S125, Math Horizons, Vol. 15, Issue 4, April 2008, p. 32. Solution published in Vol. 16, Issue 2, November 2008, p. 32.
  • D. G. Rogers, Putting Pythagoras in the frame, Mathematics Today, The Institute of Mathematics and its Applications, Vol. 44, No. 3, June 2008, pp. 123-125.

Crossrefs

Programs

  • Haskell
    a156689 n = a156689_list !! (n-1)
    a156689_list = f 1 1 where
       f u v | v > uu `div` 2        = f (u + 1) (u + 2)
             | gcd u v > 1 || w == 0 = f u (v + 2)
             | otherwise             = (u + v - w) `div` 2 : f u (v + 2)
             where uu = u ^ 2; w = a037213 (uu + v ^ 2)
    -- Reinhard Zumkeller, Nov 09 2012
  • Mathematica
    PrimitivePythagoreanTriplets[n_]:=Module[{t={{3,4,5}},i=4,j=5},While[i
    				

Formula

A156689(n)=1/2 (A020884(n)+A156678(n)-A156679(n))
Previous Showing 21-30 of 32 results. Next