|
|
A252849
|
|
Numbers with an even number of square divisors.
|
|
7
|
|
|
4, 8, 9, 12, 18, 20, 24, 25, 27, 28, 36, 40, 44, 45, 49, 50, 52, 54, 56, 60, 63, 64, 68, 72, 75, 76, 84, 88, 90, 92, 98, 99, 100, 104, 108, 116, 117, 120, 121, 124, 125, 126, 128, 132, 135, 136, 140, 144, 147, 148
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Closed lockers in the locker problem where the student numbers are the set of perfect squares.
The locker problem is a classic mathematical problem. Imagine a row containing an infinite number of lockers numbered from one to infinity. Also imagine an infinite number of students numbered from one to infinity. All of the lockers begin closed. The first student opens every locker that is a multiple of one, which is every locker. The second student closes every locker that is a multiple of two, so all of the even-numbered lockers are closed. The third student opens or closes every locker that is a multiple of three. This process continues for all of the students.
A variant on the locker problem is when not all student numbers are considered; in the case of this sequence, only the square-numbered students open and close lockers. The sequence here is a list of the closed lockers after all of the students have gone.
Numbers k such that the largest square dividing k (A008833) is not a fourth power.
The asymptotic density of this sequence is 1 - Pi^2/15 = 1 - A182448 = 0.342026... (Cesàro, 1885). (End)
|
|
LINKS
|
|
|
FORMULA
|
Numbers k such that A046951(k) mod 2 = 0.
Numbers k such that A335324(k) > 1.
(End)
|
|
MATHEMATICA
|
Position[Length@ Select[Divisors@ #, IntegerQ@ Sqrt@ # &] & /@ Range@ 150, _Integer?EvenQ] // Flatten (* Michael De Vlieger, Mar 23 2015 *)
|
|
PROG
|
(C++)
#include <iostream>
using namespace std;
int main()
{
const int one_k = 1000;
//all numbers in sequence up to one_k are given
int lockers [one_k] = {};
int A = 0;
while (A < one_k) {
lockers [A] = A+1;
A = A + 1;
}
int B = 1;
while ( ((B+1) * (B+1)) <= one_k) {
int C = ((B+1) * (B+1));
int D = one_k/C;
int E = 1;
while (E <= D) {
lockers [(C*E)-1] = -1 * lockers [(C*E)-1];
E = E + 1;
}
B = B + 1;
}
int F = 0;
while (F < one_k) {
if (lockers [F] < 0) {
cout << (-1 * lockers [F]) << endl;
}
F = F + 1;
}
return 0;
(PARI) isok(n) = sumdiv(n, d, issquare(d)) % 2 == 0; \\ Michel Marcus, Mar 22 2015
(Haskell)
a252849 n = a252849_list !! (n-1)
a252849_list = filter (even . a046951) [1..]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|