login
Integers m such that m+1 divides lcm(1 through m).
11

%I #47 Dec 02 2025 03:17:14

%S 5,9,11,13,14,17,19,20,21,23,25,27,29,32,33,34,35,37,38,39,41,43,44,

%T 45,47,49,50,51,53,54,55,56,57,59,61,62,64,65,67,68,69,71,73,74,75,76,

%U 77,79,81,83,84,85,86,87,89,90,91,92,93,94,95,97,98,99,101,103,104,105,107

%N Integers m such that m+1 divides lcm(1 through m).

%C Integers m for which A003418(m) = A003418(m+1).

%C a(n) = A024619(n) - 1. Proof:

%C If N+1 is a power of a prime (N+1=P^K), then only smaller powers of that prime divide numbers up to N and so lcm(1..N) doesn't have K powers of P; that is, N+1=P^K doesn't divide lcm(1..N).

%C From _Don Reble_, Mar 12 2003: (Start)

%C If N+1 is not a power of a prime, then it has at least two prime factors. Call one of them P, let K be such that P^K divides N+1, but P^(K+1) doesn't, and let N+1=P^K*R. Then

%C - R is greater than 1 because it is divisible by another prime factor of N+1;

%C - P^K and R are each less than N+1 because the other is greater than one;

%C - lcm(P^K,R) divides lcm(1..N) because 1..N includes both numbers;

%C - lcm(P^K,R)=N+1 because P doesn't divide R;

%C - N+1 divides lcm(1..N). (End)

%H David A. Corneth, <a href="/A080765/b080765.txt">Table of n, a(n) for n = 1..10000</a>

%H Andrei Asinowski, Cyril Banderier, and Benjamin Hackl, <a href="https://arxiv.org/abs/2003.04912">Flip-sort and combinatorial aspects of pop-stack sorting</a>, arXiv:2003.04912 [math.CO], 2020.

%F a(n) ~ n. - _David A. Corneth_, Aug 30 2019

%e 17 is the sequence because lcm(1,2,...,17)=12252240 and 17+1=18 divides 12252240.

%t Select[Range[120], Divisible[LCM @@ Range[#], #+1]&] (* _Jean-François Alcover_, Jun 21 2018 *)

%o (PARI) a=1;for(n=1,108,a=lcm(a,n);if(a%(n+1)==0,print1(n,","))) \\ _Klaus Brockhaus_, Jun 11 2004

%o (PARI) first(n) = {my(u = max(2*n, 50), charact = vector(u, i, 1), res = List()); forprime(p = 2, 2*n, for(t = 1, logint(u, p), charact[p^t - 1] = 0)); for(i = 1, u, if(charact[i] == 1, listput(res, i); if(#res >= n, return(res)))); res } \\ _David A. Corneth_, Aug 30 2019

%o (SageMath)

%o [x - 1 for x in (1..108) if not is_prime_power(n)] # _Peter Luschny_, May 23 2013

%o (Python)

%o from sympy import primepi, integer_nthroot

%o def A080765(n):

%o def f(x): return int(n+sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))

%o m, k = n, f(n+1)

%o while m != k: m, k = k, f(k+1)

%o return m # _Chai Wah Wu_, Dec 01 2025

%Y Cf. A003418.

%K nonn,easy

%O 1,1

%A _Lekraj Beedassy_, Mar 10 2003

%E More terms from _Klaus Brockhaus_, Jun 11 2004